I’ve been looking for the best WordPress hosting for me and I’m wondering how many MySQL connections at once WordPress requires? I know this is kind of general question but how does it look for you?
I’m going to host around 3-5 WordPress installs and each will have around 80 000 page views monthly (around 20 000 unique users monthly).
I’m wondering if 30 concurrent connections would be enough? Because most of the hosting companies (I can’t afford VPS yet) limit these connections to 25 or 30.
Could you share your WP unique users / page views and how many concurrent connections they generate? 30 sounds quite low but I’ve been told that it’s not that easy to exceed at all. I know it depends on the theme etc., but let’s say I’m going to use fairly optimized ones.
I can’t check it for myself yet as all my sites are still hosted locally 🙂
This is kind of weird because I know of guys who host multiple themes on MediaTemple’s (grid) service which allows 25 concurrent connections and folks at WordPress forums say even 50 is way too low…
Are there any benchmarks / test that I could perform on my theme to see how many MySQL connections it opens while I browse the pages?
IMHO that would depend on the hosting company and what resources you are limited to.
Let’s say you pick Amazon’s MySQL RDS. There are seven server models permitted. Each model allows a maximum value for the number of connections.
I wrote a post about this last month in the DBA StackExchanage : Should I increase max_connections in AWS RDS t1-micro for MySQL?. Here is a chart from my post:
Although you can pay for more IOPs per server model, this does not help with connections. You are pretty much locked in with the given numbers for max_connections.
If you do not like where MySQL RDS locks you in, then you could switch to Amazon EC2. See my post Too Many database connections on Amazon RDS where I recommend switching to Amazon EC2 to have far more indepedence and responsibility for tuning MySQL for Connections, Memory, Disk, and so forth.
Of course, the pricing for Amazon may shy you away from RDS and EC2. This example shows you basically two principles:
Although a mitigating factor, budget concerns are beyond the scope this answer.
WordPress uses one connection for all queries, so realistically, it uses one connection per request. So if you have 30 people hit the site at the same time, it will use 30 connections. Simple, really.