# almost 100% CPU used, but every night only between 22h and 24H

**URL:** <https://forums.percona.com/t/almost-100-cpu-used-but-every-night-only-between-22h-and-24h/539>\
**Category:** Other MySQL® Questions\
**Created:** [November 24, 2007, 5:07am UTC](https://forums.percona.com/t/almost-100-cpu-used-but-every-night-only-between-22h-and-24h/539 "2007-11-24T05:07:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![charlie](https://avatars.discourse-cdn.com/v4/letter/c/d6d6ee/32.png) [@charlie](https://forums.percona.com/u/charlie)\
**Post date:** [November 24, 2007, 5:07am UTC](https://forums.percona.com/t/almost-100-cpu-used-but-every-night-only-between-22h-and-24h/539/1 "2007-11-24T05:07:22Z")

</div>

Hi,

we have a mysql server (bi xeon dual core), with 6 GB of memory.  
all works perectly during the day (maximum connections between 18H and 20H, but still very hight at the end of the day), but every night, nearly 22H, mysql use something like 97% of the cpu (380% with top commande).  
and at midnight, it stops.

The server is configured so that only our tomcat/apache/mod\_jk can access to the database.

server version : 5.0.45-Debian\_1

we have also strange values in phpmyadmin (server process):  
Innodb\_buffer\_pool\_reads 25  
Innodb\_buffer\_pool\_pages\_dirty 32  
Innodb\_row\_lock\_time\_avg 3 785  
Innodb\_row\_lock\_time\_max 11 k  
Innodb\_row\_lock\_waits 18  
Handler\_read\_rnd\_next 1366  
Handler\_read\_rnd 2 784k

Qcache\_lowmem\_prunes 197 k  
Created\_tmp\_disk\_tables 97k  
Opened\_tables 260  
Select\_full\_join 2

i know there are some troubles in SQL queries, we are working on that (in fact i just arrived in the project).  
But what i can’t undertsand is why it is every night at the same time.  
We have automatic updates every hours made by a tomcat thread.

here the my.cfg for information :  
key\_buffer = 64M  
max\_allowed\_packet = 16M  
thread\_stack = 128K  
thread\_cache\_size = 10 (change from 8 to 1à today)  
max\_connections = 5000 (will change to 100 today)  
table\_cache = 256 (will change to 300 today)  
wait\_timeout = 60 (just put this one today 11/24/2007 in the config file)  
#thread\_concurrency = 10

# 

# \* Query Cache Configuration

# 

query\_cache\_limit = 1M  
query\_cache\_size = 16M

thanks for help.

---

<div class="post-metadata">

**Author:** ![sterin](https://avatars.discourse-cdn.com/v4/letter/s/3ab097/32.png) [@sterin](https://forums.percona.com/u/sterin)\
**Post date:** [November 24, 2007, 11:08am UTC](https://forums.percona.com/t/almost-100-cpu-used-but-every-night-only-between-22h-and-24h/539/2 "2007-11-24T11:08:19Z")

</div>

Two options:  
1.  
Turn on query log so that know what queries are being issued during this time.

1. 

Log in to the mysql server during this time and run a “SHOW PROCESSLIST;”.

Because _you_ will have to find out what your server is doing.  
It is nothing that MySQL does by itself. Something is running queries against the server at this time.

Some suggestions if the load is very repetitive to a certain time is scheduled things like:  
Some sort of report tool?  
Backups?  
etc.  
Which very often are placed on schedule during the night.
