concurrent users over xmlrpc
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
New
|
Undecided
|
Unassigned |
Bug Description
Setup:
1 x ubuntu 12.04 LTS server (all updates applied)
python 2.7.3
postgresql 9.1
openerp 6.1
We wanted to run some load tests based on the simple create_partner.py example that everyone uses. When we put 100 concurrent users, logging in and creating 100 partners (one at a time) using JMeter we get some errors:
2012-06-12 19:51:42,843 2210 DEBUG ? openerp.sql_db: ConnectionPool(
2012-06-12 19:51:42,843 2210 ERROR ? openerp.osv.osv: Uncaught exception
Traceback (most recent call last):
File "/usr/lib/
return f(self, dbname, *args, **kwargs)
File "/usr/lib/
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/usr/lib/
return getattr(object, method)(cr, uid, *args, **kw)
File "/usr/lib/
cr.
File "/usr/lib/
return f(self, *args, **kwargs)
File "/usr/lib/
res = self._obj.
TransactionRoll
CONTEXT: SQL statement "SELECT 1 FROM ONLY "public"
2012-06-12 19:51:42,844 2210 ERROR ? openerp.netsvc: could not serialize access due to concurrent update
After seeing this error I decided to update the db_maxconn property to 1000, to ensure you have enough connections for the test. But I still see errors like the one below:
2012-06-12 19:57:14,811 6327 DEBUG ? openerp.sql_db: ConnectionPool(
2012-06-12 19:57:14,811 6327 ERROR ? openerp.netsvc: Object Error
Object res.partner doesn't exist
2012-06-12 20:20:26,636 15119 ERROR ? openerp.sql_db: bad query: SELECT id from res_users
Traceback (most recent call last):
File "/usr/lib/
res = self._obj.
OperationalError: could not obtain lock on row in relation "res_users"
2012-06-12 20:20:26,745 15119 ERROR ? openerp.sql_db: bad query: insert into "res_partner" (id,"customer"
Traceback (most recent call last):
File "/usr/lib/
res = self._obj.
TransactionRoll
2012-06-12 20:20:26,779 15119 ERROR ? openerp.sql_db: bad query: insert into "res_partner" (id,"customer"
Traceback (most recent call last):
File "/usr/lib/
res = self._obj.
TransactionRoll
Please find attached the JMeter file you can use to launch the test. You will need to change the IP addresses, admin account/password and database probably.
The test environment consists of one box with Ubuntu 12 LTS Server with Postgres 9.1 and OpenERP 6.1 (CRM + Employee Directory modules + demo data).
/usr/bin/
Same test with gunicorn sync (no gevent). Please find attached the gunicorn configuration. Please look at this well. There could be concurrency issues with some of the underlying SQL statements.
2012-06-12 17:17:33,826 1368 ERROR openerp openerp.sql_db: bad query: insert into "res_partner" (id,"customer"
Traceback (most recent call last):
File "/usr/lib/
res = self._obj.
TransactionRoll
CONTEXT: SQL statement "SELECT 1 FROM ONLY "public"
2012-06-12 17:17:33,827 1368 ERROR openerp openerp.osv.osv: Uncaught exception
Traceback (most recent call last):
File "/usr/lib/
return f(self, dbname, *args, **kwargs)
File "/usr/lib/
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/usr/lib/
return getattr(object, method)(cr, uid, *args, **kw)
File "/usr/lib/
cr.
File "/usr/lib/
return f(self, *args, **kwargs)
File "/usr/lib/
res = self._obj.
TransactionRoll
CONTEXT: SQL statement "SELECT 1 FROM ONLY "public"
2012-06-12 17:17:33,831 1368 ERROR openerp openerp.netsvc: could not serialize access due to concurrent update
CONTEXT: SQL statement "SELECT 1 FROM ONLY "public"
2012-06-12 17:17:33,843 1369 ERROR openerp openerp.sql_db: bad query: insert into "res_partner" (id,"customer"
Traceback (most recent call last):
File "/usr/lib/
res = self._obj.
TransactionRoll
CONTEXT: SQL statement "SELECT 1 FROM ONLY "public"
2012-06-12 17:17:33,847 1369 ERROR openerp openerp.osv.osv: Uncaught exception
Traceback (most recent call last):
File "/usr/lib/
return f(self, dbname, *args, **kwargs)
File "/usr/lib/
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/usr/lib/
return getattr(object, method)(cr, uid, *args, **kw)
File "/usr/lib/
cr.
File "/usr/lib/
return f(self, *args, **kwargs)
File "/usr/lib/
res = self._obj.
TransactionRoll
Traceback (most recent call last):
File "/usr/lib/
res = self._obj.
TransactionRoll
CONTEXT: SQL statement "SELECT 1 FROM ONLY "public"
2012-06-12 17:17:33,853 1371 ERROR openerp openerp.osv.osv: Uncaught exception
Traceback (most recent call last):
File "/usr/lib/
return f(self, dbname, *args, **kwargs)
File "/usr/lib/
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/usr/lib/
return getattr(object, method)(cr, uid, *args, **kw)
File "/usr/lib/
cr.
File "/usr/lib/
return f(self, *args, **kwargs)
File "/usr/lib/
res = self._obj.
TransactionRoll
CONTEXT: SQL statement "SELECT 1 FROM ONLY "public"
2012-06-12 17:17:33,854 1369 ERROR openerp openerp.netsvc: could not serialize access due to concurrent update
CONTEXT: SQL statement "SELECT 1 FROM ONLY "public"
pdate
CONTEXT: SQL statement "SELECT 1 FROM ONLY "public"
2012-06-12 17:17:33,855 1371 ERROR openerp openerp.netsvc: could not serialize access due to concurrent update
CONTEXT: SQL statement "SELECT 1 FROM ONLY "public"
2012-06-12 17:17:33,895 1370 ERROR openerp openerp.sql_db: bad query: SELECT id from res_users
Traceback (most recent call last):
File "/usr/lib/
res = self._obj.
OperationalError: could not obtain lock on row in relation "res_users"
my original test was of 100 users (threads) and 100 partners, one at a time. however, this can be brought down to 6 users (threads) and 1 partner. no loops needed. so 6 people creating 1 partner at the same time.