Answer the question
In order to leave comments, you need to log in
Why is mongodb loading the system up to 100%?
Good morning colleagues, I have this problem:
There is a server:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 8
CPU MHz: 3699.984
BogoMIPS: 7200.07
Virtualization : VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 8192K
64 gb memory and 520gb ssd
Active connections: 14917
server accepts handled requests
277170 277170 36352500
Reading: 0 Writing: 6100 Waiting: 8770
The server has nginx + php5-fpm and mongodb installed, at the moment 15k users are breaking into the server, 7 of which nginx manages to process, the rest are in the Waiting status: 8353
htop shows that all processor cores are loaded and the heaviest process is mongodb, tell me where dig and what to do!
Answer the question
In order to leave comments, you need to log in
Optimize database queries.
I myself had the same problem (true on mysql, but I think the essence is the same). The problem was that I made a lot of requests for 1 table (select and update) with 1.5M records => requests were executed for 1+ seconds => they were queued => they loaded the processor. I solved the problem by removing requests for reading from this table, making a separate table, where there were already calculated values.
Upd. I am not familiar with mongodb, but I googled the analogue of SHOW PROCESS LIST for mongodb: https://docs.mongodb.org/manual/reference/method/d...
tell me where to dig and what to do!
https://docs.mongodb.org/manual/tutorial/manage-th... Turn on the
slow query log and see what the problem is.
Surely they forgot to add the index somewhere and the monga pulls out some queries by exhaustive search.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question