So I have this machine running an XMPP server which connects to its MySQL database. When I start load-testing it, all goes fine up until after about 500s when I notice:
Caused by: com.mysql.jdbc.exceptions.MySQLTimeoutException: Statement cancelled due to timeout or client request
starting to appear. As they do, the command:
mysql> show processlist;
reveals how MySQL is receiving the next queries, answers them (state = sending data was caught on tape), then just idly sits in state = Sleep for 20s, 40s, or even more. In all this time the PreparedStatement.execute() method call does not return. The top
command reveals no more than 800% CPU usage (16 cores - half of them are used at peak).
I have checked /var/log/messages and a few other places in /var/log for errors on the XMPP server machine without any clue given away. I also tried another JDBC connector, another MySQL server, updated JRE, without improvement. Where should I be looking further?
What next ? Thanks!
EDIT: Checked some more and this is not related to neither the number of threads pumping & pushing queries from their queues, nor to queries / second, nor to a specific machine, nor to the kind of SQL queries being run or number of connections to MySQL. I have also inspected a tcpdump
capture and the server is answering back to queries in some milliseconds. The rest of the time... It is just the client somehow not fetching that result in TCP user space.
But in all the tests there is a metric that remains unchanged - when it hits a little past 30k simultaneously connected users (users of XMPP servers) - that is when the trouble starts.