In my latest project, I have to write a web service API to return data from a database.
Techs are
– SQL Server 08 R2
– WCF
The data is mainly key-value pairs, e.g. for get user X’s favourite colour.
The load isn’t massive, but not small-fry either – about 1,000 requests / sec at peak.
My initial thoughts are to use Redis as the cache, meaning we don’t hit SQL Server as often. However I’ve been trying to get some benchmarks etc out of this configuration, and it’s not great, making me wonder if Redis will really offer any benefit for my problem!
Architecture is
– separate db server
– WCF App Server – IIS
– Linux Redis server
When playing around on my desktop, the Redis benchmarks at ~ 20K ops / sec. Great stuff.
However, given that each call will go through a web service, when I put a WCF layer I can only get 300 ops / sec. Not great. Admittedly, web service client, web service and database are all on the same machine, so that might skew the results!
Also, when moving to the real environment, network latency will be a major factor.
I can’t batch these requests up in any way.
So – my question – I’m all for using Redis as a cache – I know I should use a cache in this situation – but given that I can’t have Redis on the same box as my Web Services then won’t network latency kill performance?
Any advice greatly appreciated!
Duncan