About |
About.PerformanceTests-PreparedStatements HistoryHide minor edits - Show changes to markup May 14, 2013, at 02:16 PM
by
- Changed line 1 from:
About -> Performance Tests -> MySQL prepared statementsto:
About -> Performance Tests -> MySQL prepared statementsMay 09, 2013, at 12:55 PM
by
- Changed line 1 from:
About -> Performance Tests -> MySQL prepared statementsto:
About -> Performance Tests -> MySQL prepared statementsApril 24, 2013, at 02:18 PM
by
- Added lines 1-140:
About -> Performance Tests -> MySQL prepared statementsThis page has been visited 35256 times. (:toc-float Table of Content:) Starting with OpenSIPS 1.5.0 the internal DB API provides support for prepared statements. First DB module to implement prepared statements is DB_MYSQL module. See more about the concept of prepared statements in MySQL. The tests were conducted in order to determine the real gain of prepared statements. The tests tried to cover various case - combinations between complexity of a query and the amount of data transfered by a query. A very good overview on Prepared Statements, that may help you in understating the advantages and disadvantages of prepared statements can be found at http://www.mysqlperformanceblog.com/2006/08/02/mysql-prepared-statements/ . It is essential to understand that prepare statements do not bring only performance, but more security also! What are the theoretical gains ?Client side:
Server side:
Limitations ?Query cache does not work for prepared statements, but considering that the OpenSIPS data is very large and various, it is not something to affect the performance (as the below results shows). Prepared statements have a gain in speed only if used more than once - for this reason, only the queries which are repetitively used in OpenSIPS are converted to prepared statements ; initial load are still using standard queries. Performance testsThe tests were done using OpenSIPS 1.4.4 as reference point for DB query performance without prepared statements. OpenSIPS 1.5.0 is the candidate measurements with prepared statements. Notes:
DB Authentication testThis test (using auth_db module) was focus in measuring he gain of a simple query:
Scenario: REGISTER requests, challenged and authenticated. http://www.opensips.org/uploads/Resources/stmt_auth_char.gif | Chart 1 Results:
-> BOOST = 21 % See full size chart See OpenOffice SpreadSheet with all result values.
User location testThis test (using usrloc module) was focus in measuring he gain of more complex query:
Scenario: REGISTER requests, no authentication, http://www.opensips.org/uploads/Resources/stmt_usrloc_char.gif | Chart 2 Results:
-> BOOST = 25 % See full size chart See OpenOffice SpreadSheet with all result values.
SIPTrace testThis test (using siptrace module) was focus in measuring he gain of simple, but datafull query:
Scenario: REGISTER requests, no authentication, http://www.opensips.org/uploads/Resources/stmt_siptrace_char.gif | Chart 3 Results:
-> BOOST = 23 % See full size chart See OpenOffice SpreadSheet with all result values.
Sitthipong? — 19 August 2012, 18:24(:commentboxchrono:) |