Mysql – Performance: thesql socket vs. thesql remote

MySQLperformanceremotesocket

I'm running a couple of projects which consume a lot of MySQL power (10'000 qps in peaktimes)…now I'm wondering what would be the best setup in order to keep it fast and smooth even if the user numbers grow.

Currently I'm using 1 server with nginx, php-fpm and mysql (dual xeon, 24 GB ram, SSD's) and connecting to MySQL through a local socket.

Would I experience a "performance drop" if i had a remote MySQL server of the same specification in order to split up webserver / db load?

Best Answer

There will be a performance hit, but rather in the latency part. So if you run a lot of parallel connections, you probably won't notice. If you're doing 10kqps serially in one (or just a few) connection, you'll definately see a difference.

The query processing itself will not take longer, just the data roundtrip time from and to the client will increase (even 10Gbit ethernet would play a role here) by around a milisecond or so (for 1Gbit line). So if the query itself took another milisecond, you're limited to about 500qps per connection.

With local socket, the roundtrip time is pretty much in tens-of-microseconds range ...