> I'm using both APC and Memcached. I had to setup a "two-layers" > caching system. First I'm caching into Memcached and then caching into > APC. I guess it's pretty dirty but that's the only solution I found to > reduce significantly the amount of GET to Memcache. > > APC is local to each web obviously and Memcache is going through > network, so I assumed it was normal that APC would be much faster. But > somehow I feel something's wrong because Memcache sometimes is really > slow, and eventully even hit the 1s timeout. > > I have done a small and stupid benchmark : > > --------------- > Testing 1000 GETs. > > Value size : 149780 Bytes > > Memcache Testing... > Value size : 149780 Bytes > Time: 13.78 seconds. > > APC Testing... > Value size : 149780 Bytes > Time: 0.31 seconds. > ---------------
Not entirely sure what you're bottlenecking on? Is your issue that APC is faster than memcached, or you hit some limit? This benchmark isn't that enlightening. That value size is pretty large. ~146k/req, 1000 reqs. 146 megabytes. 13.78 seconds is 10.6 megabytes/sec, which is about 85 megabits? If you're going over the network, is your webserver capped at 100 mbits? Otherwise, what *is* the value? Provide your whole bench script? When talking to memcached you have to fully serialize/deserialize the data. APC doesn't necessarily have to do that. For large values this can take a long time. The other issue here is that you're not testing what memcached actually does. The limit isn't in how many requests you can fetch in a loop. If you're doing that you should hit yourself. Memcached is there so your 40 webservers can all access it at the same time and still get useful speed from it. In my experience the network has always been the bottleneck, unless you're running it on an atom box or something. > Would you say this is normal response time? And normal to see APC that > much faster? Yes. APC will be faster. > I'm not even sure how to debug this. Once again, what's the *actual issue* you're seeing? > ./mc_conn_tester.pl 10.0.0.23:11211 1000 1 > Averages: (conn: 0.00050306) (set: 0.00057981) (get: 0.00046550) That seems fine... half a millisecond-ish? normal for an over the network ping. -Dormando
