Mike Looijmans
nlv11281 at natlab.research.philips.com
Thu Aug 9 01:34:35 EDT 2007
> In this regard, I have another question: should each request open it's own > MySQL connection (the connection to our DB slave servers), or only one > connection should be opened, and passed around between requests using > DbmSession or some other means? I tried benchmarking my connection pool against setting up a connection for each and every request. I found that I could not prove any improvement in speed for MySQL 3 or 4, so I would not start on that path. MySQL can handle hundreds of connections just fine. Just set up the database to accept many connections. Set up MySQL to use unix sockets (or named pipes on Windows) and preferably switch off TCP/IP completely in MySQL if the DB and web services run on the same machine. Also, if the database plays a significant role, configure MySQL to use more resources than what it allocates by default. For some statistics crunching DB tasks, I assigned half the machine's RAM as index buffer. Switching on MySQL's query cache is also very useful if you are likely to run the exact same query multiple times. This happens for example if you check user access rights or session data in the DB. With MySQL, if your machine cannot handle the load, add another machine and use replication. You can do the same for your web server, by the way. Mike Looijmans Philips Natlab / Topic Automation
|