Yesterday I had a huge load on my servers, and even if I worked on optimizing performance earlier (I had a similar problem about 2 months ago), my servers could not cope with the load (I have a service that had about 50 creations in minute).
Finally, my servers handled the load because I changed the instances: I am on Amazon EC2 and I used a load balancer with 20 micro instances. This was not enough. Finally, I changed to 10 large copies, and everything was fine. But, you know, large instances of the road, and I can not afford to have so many large instances (now, since there is less load, I only have "5 large instances, but this is too much).
So, I'm still working on optimizing and configuring the server, but I'm stuck on a point.
So far I am using symfony with memcached. It works great, everything you need to cache is cached, etc.
Now I want to add varnish in front of the apache web server.
I did it and I set it up - I think ... well, and it works now. The problem is that there is no hit in the cache.
From what I saw, the problem is that the HTTP headers sent by symfony are not set correctly. For example, for a cached request, I have the following headers:
Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache
The module is configured correctly to use cache, etc., but I just can't find where I can set the correct HTTP headers. I know how to set the cache header in symfony for a specific action, but I'm sure I donโt want to do this with every action (by the way, even if I did this, I think this is the wrong way).
So, I ask how I can use Varnish with symfony 1.4. From what I saw, there are two possibilities:
- I set the HTTP headers sent by symfony correctly
- I configure Varnish to correctly handle default HTTP headers sent by symfony
Do you know how I can fix one of the problems?
Thanks,
NB: I'm on Varnish3