Strange performance numbers
Fri, 12 Sep 2003 12:22:04 -0700 (PDT)
Sorry I didn't file a more comprehensive bug report. I'm running:
All perl modules (DBI, DBD::Pg) are the latest from CPAN as of yesterday.
My server is a single P4 2GHz, 1GB RAM, 1x 7200 RPM IDE HD, running all of
the above software as well as Apache Bench which I am using for the
performance testing. I know running so much on a single underpowered
computer is less than ideal, but that's all we can afford at this point.
My results for using memcached vs strait PostgreSQL requests for either
session lookup and search lookup are as follows:
10000 Requests/Iteration, 100 Concurrent Connections, Units Requests/Sec
Cached Iter 1 Iter 2 Iter 3
Both 127.77 193.03 193.22
None 110.82 188.78 186.34
Sess 108.43 173.49 173.20
Search 132.36 201.69 200.78
The first iteration is after an apache graceful reload and should be
ignored. The second and third iterations are reasonably stable.
I think that in my situation, memcached does not offer much of a
performance advantage. If our project is successful and we can move to a
multi-server configuration where the DB is on a separate server I will
re-evaluate using memcached.
On Fri, 12 Sep 2003, Brad Fitzpatrick wrote:
> Which client API?
> Which server version? server OS? epoll?
> Compression on or off?
> Did you time requests thousands of times and average? 8-45 ms alone is
> just noise.
> Even if memcache were a bit slower than MySQL (which it's not), you'd
> still win because memcache never blocks. Did you test your application in
> parallel (say, 50 simultaenous clients doing 500 requests) or just one
> On Fri, 12 Sep 2003, Ryan Mack wrote:
> > I'm using memcached for the first time tonight. I have a page with two DB
> > queries. Without memcached at all (not in the code at all, requests take
> > 12ms. With only the first query using memcache, requests take 10ms.
> > With only the second query using memcache, requests take 8ms. With both
> > queries using memcached, requests take 45ms. This makes no sense to me at
> > all. Am I doing something wrong?
> > Please reply by personal email, I am not subscribed.
> > Thanks, Ryan