Dear All,
I have an instance running ERPNext which has the following configuration
2 Cores, 14GB Ram, 100 GB SSD
There are around 25 users but it has become very slow since the past few days
It takes about 60 seconds to save a Sales Invoice with 10 Items
I have tried restarting the bench and supervisor but it did not help.
We changed the innodb_buffer_pool_size to 9.7GB here is what it looks like now
innodb_buffer_pool_size = 10000M
innodb_log_buffer_size = 8M
innodb_file_per_table = 1
innodb_open_files = 400
innodb_io_capacity = 400
innodb_flush_method = O_DIRECT
Also increased the maxmemory in redis_cache.conf to 1350mb
Here is what the redis_cache.conf
bind 127.0.0.1
port 13000
maxmemory 1350mb
maxmemory-policy allkeys-lru
appendonly no
On checking the web.error.log this is what I found.
[2018-01-02 13:06:42 +0000] [2123] [ERROR] Error handling request /api/method/frappe.async.can_subscribe_doc?sid=e619eed72445b3ac517bddfb55e7b0543c8c42d9c89$
Traceback (most recent call last):
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/gunicorn/workers/sync.py”, line 135, in handle
self.handle_request(listener, req, client, addr)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/gunicorn/workers/sync.py”, line 176, in handle_request
respiter = self.wsgi(environ, resp.start_response)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/werkzeug/local.py”, line 228, in application
return ClosingIterator(app(environ, start_response), self.cleanup)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/werkzeug/wrappers.py”, line 301, in application
return f(*args[:-2] + (request,))(*args[-2:])
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 83, in application
response = handle_exception(e)
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 131, in handle_exception
if frappe.local.is_ajax or ‘application/json’ in frappe.get_request_header(‘Accept’):
TypeError: argument of type ‘NoneType’ is not iterable
Here are the memory stats of the system:
total used free shared buffers cached
Mem: 13G 1.7G 12G 440K 22M 153M
-/+ buffers/cache: 1.5G 12G
Swap: 4.0G 0B 4.0G
Here are the file system stats:
Filesystem Size Used Avail Use% Mounted on
udev 6.9G 12K 6.9G 1% /dev
tmpfs 1.4G 416K 1.4G 1% /run
/dev/sda1 30G 13G 16G 46% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
none 5.0M 0 5.0M 0% /run/lock
none 6.9G 0 6.9G 0% /run/shm
none 100M 0 100M 0% /run/user
/dev/sdb1 99G 60M 94G 1% /mnt
The slow query log is logging this query repeatedly
# Time: 180103 4:36:51
# User@Host: 1bd3e0294da19198[1bd3e0294da19198] @ localhost []
# Thread_id: 343 Schema: 1bd3e0294da19198 QC_hit: No
# Query_time: 17.492096 Lock_time: 0.000037 Rows_sent: 2 Rows_examined: 432185
# Rows_affected: 0
# Full_scan: Yes Full_join: No Tmp_table: No Tmp_table_on_disk: No
# Filesort: Yes Filesort_on_disk: No Merge_passes: 0 Priority_queue: Yes
SET timestamp=1514954211;
select name, owner, creation, data from `tabVersion` where `tabVersion`.docname = "Stock Balance" and `tabVersion`.ref_doctype = "Report"
order by creation desc limit 0, 10;
# Time: 180103 4:37:41
# User@Host: 1bd3e0294da19198[1bd3e0294da19198] @ localhost []
# Thread_id: 375 Schema: 1bd3e0294da19198 QC_hit: No
# Query_time: 17.127635 Lock_time: 0.000066 Rows_sent: 1 Rows_examined: 432184
# Rows_affected: 0
# Full_scan: Yes Full_join: No Tmp_table: No Tmp_table_on_disk: No
# Filesort: Yes Filesort_on_disk: No Merge_passes: 0 Priority_queue: Yes
SET timestamp=1514954261;
select name, owner, creation, data from `tabVersion` where `tabVersion`.docname = "Wide Vision" and `tabVersion`.ref_doctype = "Customer"
order by creation desc limit 0, 10;