Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database is busy #8

Closed
jonasmalacofilho opened this issue Jan 3, 2018 · 3 comments
Closed

Database is busy #8

jonasmalacofilho opened this issue Jan 3, 2018 · 3 comments

Comments

@jonasmalacofilho
Copy link
Member

jonasmalacofilho commented Jan 3, 2018

We got two of those today.

Before porting to MySQL (plan C), we should consider fixing SQLite's driver to actually deal with errors (plan B/errors happen, Nicolas).

But plan A is: restart the machine and see if the planned maintenance by Azure improves filesystem performance and reliability.

Note: SQLite's central source code repository and website both use a single SQLite database, and they handle that load just fine. Yeah, we should use MySQL for many reasons, but none of them is to handle 600 requests in an hour (even though peaks of maybe 50 request/min + a lot of calls to sendgrid and acesso are not something to take lightly).

@jonasmalacofilho
Copy link
Member Author

The SQLite website (https://www.sqlite.org/) uses SQLite itself, of course, and as of this writing (2015) it handles about 400K to 500K HTTP requests per day, about 15-20% of which are dynamic pages touching the database. Dynamic content uses about 200 SQL statements per webpage. This setup runs on a single VM that shares a physical server with 23 others and yet still keeps the load average below 0.1 most of the time.
Appropriate Uses For SQLite

@jonasmalacofilho
Copy link
Member Author

Manual database fix executed:

-- Jan 03 16:38:03 BelCard env[58202]: [async-52c8]
UPDATE RemoteCallLog SET responseCode = 200, responseData = '{"ExecutionTimeInMs":986.79770000000008,"FieldErrors":[],"Message":"Alteracao_realizada_com_sucesso","ResultCode":0,"ResultId":0,"_ExternalServicesElapsedTimes":null}', timing = '1.09189796447754' WHERE id = 317;


-- Jan 03 17:10:09 BelCard env[58202]: [dd50]
-- UPDATE CardRequest SET state = 'wy25:db.types.CardRequestStatey9:SendEmail:0', queued = 1 WHERE requestId = 'be67dd9a2de906dea4189638d3331310ed647459bf0f6e9843fc8469d9ff7169';
-- already retried by the user: f2c9c4e949b8db8ea3c00d8edfca2d2dd9d334dd05428efec39a39233215a644

-- Jan 03 23:02:32 BelCard env[58202]: [5007]
UPDATE CardRequest SET state = 'wy25:db.types.CardRequestStatey9:SendEmail:0', queued = 1 WHERE requestId = '76812bf5700e7b6da780816649535b9f3e2d96a781243f033c6ec3bfd53030b4';

@jonasmalacofilho
Copy link
Member Author

Closed with v1.0.3 (5e11cca).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant