Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

APC and Varnish

Tags:

php

apc

varnish

I am using varnish for reverse proxy and apc for op-code caching.

Have anyone used both for same site ?

Is there an overhead between compatibility between both ?

My personal opinion is that both are not into each other domain but wanted a quick opinion based on any personal experience.

Thanks

like image 285
rahijain Avatar asked Jul 04 '11 22:07

rahijain


3 Answers

You're correct they're not in the same domain.

There is no overhead for using both. APC functions underneath your PHP system and speeds up your PHP execution time.

Varnish sits between your browser client, and your HTTP process (apache/lighttpd/etc) and caches visits to the webserver.

  • Dave
like image 116
davidjbullock Avatar answered Nov 13 '22 03:11

davidjbullock


I don't have experience with this scenario, but as far as I can see there should be no problem. If the proxy "hits", the request doesn't reach the application anyway, thus apc is not touched. If its miss, apc should speedup php. I don't see any reason, why it should be a bad idea.

like image 44
KingCrunch Avatar answered Nov 13 '22 03:11

KingCrunch


Confirmed. I am doing just this and aside from my APC cache not being configured correctly this works wonders.

like image 1
granttoth Avatar answered Nov 13 '22 03:11

granttoth