1 (edited by Jeffy 2017-06-26 13:12)

Topic: Database locking causing 503 during load testing

Hello,

my setup is:  vps with Centos 6.6, nginx, php-fpm, sqlite3

under light load testing with as little as 2 concurrent users the forum is returning 503 service unavailable errors

error logs point to database locking... any ideas on what would cause the forum to fail under such light load?


I get lots of the following errors in my logs:

2017/06/23 09:36:06 [error] 19238#19238: *20463 FastCGI sent in stderr: "PHP message: PHP Warning:  SQLite3::query(): Unable to execute statement: database is locked in /usr/share/nginx/html/example/forum/include/dblayer/sqlite3.php on line 96

PHP message: PHP Warning:  SQLite3::exec(): cannot rollback transaction - SQL statements in progress in /usr/share/nginx/html/example/forum/include/dblayer/sqlite3.php on line 116" while reading response header from upstream, client: 54.172.97.126, server: example.com, request: "GET /forum/viewtopic.php?id=1 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "example.com"

2017/06/23 09:36:06 [error] 19238#19238: *20459 FastCGI sent in stderr: "PHP message: PHP Warning:  SQLite3::query(): Unable to prepare statement: 5, database is locked in /usr/share/nginx/html/example/forum/include/dblayer/sqlite3.php on line 96" while reading response header from upstream, client: 54.172.97.126, server: example.com, request: "GET /forum/viewtopic.php?id=1 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "example.com"

Re: Database locking causing 503 during load testing

update sqlite
https://stackoverflow.com/a/12399625/5441700

Parserus - BBCode parser
I speak only Russian  :P

3

Re: Database locking causing 503 during load testing

thank you for the response, but I am hoping there is another solution...

it seems there is no easy way to update sqlite on centos and it is also inadvisable


here are some responses to updating sqlite on centos:

"You cannot and if you try it will break critical stuff. Don't try it."

"It is recommended that you do not update components of CentOS out of sync with CentOS itself."

"I'd be careful about upgrading sqlite since yum and other packages depend on the older version."