If you like DNray Forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...

 

High Server Load

Started by pathtorstensson, Oct 21, 2024, 12:15 AM

Previous topic - Next topic

pathtorstenssonTopic starter

I encountered an anomalous CPU utilization surge on the Virtual Private Server (VPS), which prompted me to investigate further. Upon running the 'top' command, I was presented with a worrisome system resource allocation scenario. I decided to drill down into the MySQL database, suspecting that it might be the culprit behind the elevated CPU load. My analysis revealed that the bottleneck was originating from a development site that was essentially dormant, with no active traffic or user engagement.

To mitigate the issue, I opted to disable the site via the Internet Service Provider (ISP) control panel, effectively severing its connection to the database. However, upon running the 'ysqladmin processlist' command, I noticed that the query still persisted, displaying a similar output:

| 3997992 | dbuser | localhost | dbname | Query | 1242555 | Sending data | SELECT SQL_CALC_FOUND_ROWS pref_posts.ID FROM pref_posts LEFT JOIN pref_icl_translations wpm | 0.000 |

This was perplexing, as the database was supposedly isolated, with no active connections or external access enabled. I couldn't help but wonder if there were any rogue connections or unaccounted-for database interactions at play.

In general, how can this persistent query be terminated without resorting to a server reboot?
  •  


Dorothy

One approach is to use the KILL command to explicitly terminate the query, followed by the process ID, in this case, 3997992. This can be done using the mysqladmin kill command or by executing a KILL statement within the MySQL client. For instance, mysqladmin kill 3997992 or mysql> KILL 3997992;. This should forcefully terminate the query and free up system resources.

Alternatively, I'd recommend checking the MySQL configuration for any rogue connections or unaccounted-for database interactions. It's possible that the query is being executed by a cron job or a scheduled task that's not immediately apparent. A thorough review of the system logs and MySQL configuration files should help identify the root cause of the issue.
  •  

ThomasPhab

Are we dealing with a static or dynamic process ID landscape, where new IDs are constantly emerging?

Is the conventional approach of terminating a process using its ID (via KILL [PROCESS-ID]) ineffective in this scenario?

Is the user identity consistent across all sites, or are there variations in user authentication and authorization?
  •  

WAO

When troubleshooting database performance issues, consider disabling the query cache to gauge its impact on system behavior. Concurrently, it's essential to scrutinize the DB configuration, particularly the innodb_buffer_pool_size parameter, which should be set to a value marginally exceeding the aggregate size of all data stored on the DB server.
This is crucial to ensure optimal data retrieval and storage efficiency, as an inadequately sized buffer pool can lead to increased disk I/O latency and decreased overall system responsiveness.
  •  


If you like DNray forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...