0

I have a VPS Debian running a nginx webserver and 2 node.js servers, one with socket.io for suplying data for my website and another one for a bot. The socket server runs a lot of queries but I try to keep them as low as possible, the bot runs some queries but not too many, the website is an ordinary website, its taking good amount of traffic, like 400 ppl on it very often. My VPS specs: CPU: 4.8Ghz(2 cores of 2.4) RAM: 2Gb HDD: 40Gb Bandwidth: 2000Gb

The website is running very slow, but its not memory or CPU usage cause those values stay between 40~60% But when i type service mysql status this is what I get:

Threads: 2 Questions: 122488 Slow queries: 0 Opens: 172 Flush tables: 1 Open tables: 113 Queries per second avg: 935.022.

And this numbers get a lot bigger when the site is crowded. I haven't changed the my.conf neither nginx.conf(only changed the root) since I'm a completely newbie at this. What Am I doing wrong? How can I log the queries to check where are all those coming from?

  • 1
    There's not near enough information to help you. You need to identify the software running the different parts of the website and how it works. I suggest page caching should reduce your website load significantly. Have a look at this other thread where I posted an nginx caching configuration http://serverfault.com/questions/749544/is-it-possible-to-terminate-ssl-with-nginx-and-cache-https-responses-from-the-ba/749665 – Tim Jan 19 '16 at 19:56

1 Answers1

0

Regarding how to log MySQL queries, this question has already been answered on StackExchange sites:

Once you find the queries involved, you can work on how reduce or optimize them. Questions about optimizing the queries may be better suited for dba.stackexchange.com.

Mark Stosberg
  • 3,901
  • 24
  • 28