Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am getting strange usage numbers on MongoDB server when it is in almost idle state: http://pastebin.com/cKVyGMts (no queries) DB size is about 3.3 Gb

I can see in mongodb.log that snapshotthread is eating too much CPU:

Wed Nov 28 19:02:14 [snapshotthread] cpu: elapsed:4000 writelock: 0% Wed Nov 28 19:02:18 [snapshotthread] cpu: elapsed:4000 writelock: 0% Wed Nov 28 19:02:22 [snapshotthread] cpu: elapsed:4000 writelock: 0% Wed Nov 28 19:02:26 [snapshotthread] cpu: elapsed:4000 writelock: 0%

And data from top confirms it:

http://pastebin.com/d57ybpBJ

(iotop shows that there are no high disk activity present)

I am running high-cpu instance on EC2, mongo confing and startup information is here: http://pastebin.com/YZyyq0gc

How i can disable snapshotting or what can cause such a high cpu usage??

share|improve this question
    
Whet version of MongoDB are you using? –  FINESEC Nov 28 '12 at 15:12
    
db version v2.0.8 from 10gen repo Centos 6.2 –  Andrei Mikhaltsov Nov 28 '12 at 15:14
    
did you try turning off snapshotting? cpu = false or just comment out cpu=true. Also check this bug out: jira.mongodb.org/browse/SERVER-2114 –  Asya Kamsky Dec 5 '12 at 22:29
    
Thanks, turning off snaphotting didnt cause any effect. I've straced mongo and found that log is filled with select and setsockopts: select(10, [8 9], NULL, NULL, {0, 10000}) = 0 (Timeout) select(10, [8 9], NULL, NULL, {0, 10000}) = 0 (Timeout) select(10, [8 9], NULL, NULL, {0, 10000}) = 0 (Timeout) select(10, [8 9], NULL, NULL, {0, 10000}) = 0 (Timeout) –  Andrei Mikhaltsov Dec 6 '12 at 10:11

1 Answer 1

According to JIRA some changes where made to memory allocation algorithm in version 2.2.0, which possibly could fix this issue.

MongoDB high CPU usage, low disk IO, very slow response

share|improve this answer
    
thank you for the answer!! unfortunately, this didn't work ;/ upgraded to db version v2.2.2, pdfile version 4.5 git version: d1b43b61a5308c4ad0679d34b262c5af9d664267 –  Andrei Mikhaltsov Nov 28 '12 at 15:54
    
ok, did you try to disable NUMA? mongodb.org/display/DOCS/NUMA –  FINESEC Nov 28 '12 at 16:28
    
restarted server with command: numactl --interleave=all /usr/bin/mongod --config /etc/mongod.conf (cat /proc/sys/vm/zone_reclaim_mode 0 - no luck;/ –  Andrei Mikhaltsov Nov 28 '12 at 16:43
    
ok, try to increase syncdelay: docs.mongodb.org/manual/reference/mongod/… –  FINESEC Nov 28 '12 at 17:20
    
no luck;/ i now think the problem is more OS specific pastebin.com/yaGL4cYm because i have 8 cores and mongod CPU usage is 2200% (!!!??) i'll try to update CentOS to the lastest version. –  Andrei Mikhaltsov Nov 29 '12 at 10:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.