View Single Post
Old 12-02-2011, 08:30 AM  
miguel7
Confirmed User
 
Industry Role:
Join Date: Dec 2001
Location: Czech Republic, Brno
Posts: 139
Quote:
Originally Posted by raymor View Post
Indeed caching can get pretty complex and problems often are not obvious, so if it's not quite working right for you better to only cache things that you're sure are safe to cache.

Having said that, if the caching server is on the same machine as the web server, caching static files can easily hurt performance. The real benefit is in (carefully) caching the output of scripts. If it's on the same machine, reading an extra "cached" copy of the file is no faster than reading the main copy. The only difference is what happens when a file is requested that's NOT in the cache, a cache miss. There's a bunch of extra overhead there, with these cache misses taking as much as for times as long to serve up than they would coming straight from Apache. So you'd be significantly better off just using Apache alone in those cases.

So in caching only static files hurts performance and a small error caching dynamic content causes complex problems. Therefore the cache will only cause you problems if you can't be confident that your dynamic scripts are consistently cached (or not) correctly.

Aside from having the caching work correctly, so as to avoid breaking things in some situations (like when the user has an iphone), if the cache isn't tuned correctly it can slow things down. Did you know that a very large cache is slower than no cache at all? So to is a very small cache, due to excessive misses. The cache has to be the right size in prefer to do you any good at all. What does all this mean? It means that if you have to come to GFY for help setting up your caching proxy, you're probably better off without a caching proxy.
Thank you for your comprehensive answer.
I think I have to say from the beginning. About 2 months ago my server started to have problems due to higher traffic. When reaching the top traffic hours, Server very often fell. (last moth stats: uptime 99.05%, downtime 6h 48m 29s, number of downtimes 117).

After reading this Stop throwing hardware at your problems. Tune your server! I sent request support I reached my patience. I requested a final solution I required Nginx on my serer. They recommend me Varnish....

It seems that it helped, no any serverdown yet, but it's only 3 days.
But according to what you wrote caching without caching PHP does not make any sense ??
miguel7 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote