CPU is 100% usage

We have installed ERPNext on Digital Ocean with 8 GB Memory / 80 GB Disk / BLR1 - Ubuntu 16.04.4 x64
CPU usage is going 100% and finally, ERP stopped working.

image

Please advice how to fix this.

Please share which cpu you are using,

I have tested with same conf on Google cloud it’s working fine without issues

Also share no instance per user is there

Did not get you, sorry. Please explain.

Check with digital ocean it seams problem with them ERPNext fine to run on machine with min configuration

This is most likely other applications or processes that are running through the process you are seeing. Try running pstree to see all subprocesses under the process you’re seeing with top.

One possible solution is to use a optimal value for innodb_buffer_pool_size if you haven’t configured it yet.

This is what we have:

innodb_buffer_pool_size = 256M
innodb_log_buffer_size = 8M
innodb_file_per_table = 1
innodb_open_files = 400
innodb_io_capacity = 400
innodb_flush_method = O_DIRECT

What is your database size ?

We’ve experienced a similar problem caused by fail2ban, a security program.

See this fail2ban-client flushlogs using 100% cpu? · Issue #1843 · fail2ban/fail2ban · GitHub

2 Likes

DB Size is 275 MB.

Agree, I stopped fail2ban service and CPU came back to normal.

1 Like

try setting the buffer pool to 512M. you won’t see changes just at the moment because it takes time to populate the cache.

1 Like

Wonderful, though Fail2ban is a very important security feature for any internet facing service.

Fail2Ban is an intrusion prevention software framework that protects computer servers from brute-force attacks. - Wikipedia

You want to take some time later and learn how to configure log rotate which basically tells your server to create a new log file after some time. Larger log files cause the CPU/RAM hog.

Here are some leads:

1 Like