Performance

From DreamFactory
Jump to: navigation, search
DreamFactoryPerformance
m
(Added notes about MySQL's too many connections error.)
 
Line 17: Line 17:
 
Like any other database-driven application, the performance of database services (MySQL, PostgreSQL, Oracle, etc.) will heavily depend upon the underlying database's tuning. Most notably, you should take care to properly index all tables used in conjunction with the service!
 
Like any other database-driven application, the performance of database services (MySQL, PostgreSQL, Oracle, etc.) will heavily depend upon the underlying database's tuning. Most notably, you should take care to properly index all tables used in conjunction with the service!
  
If you're using MySQL, consider picking up a copy of [[https://www.amazon.com/High-Performance-MySQL-Optimization-Replication/dp/1449314287 High Performance MySQL]] to learn more about MySQL tuning.
+
=== MySQL Considerations ===
 +
 
 +
If in your DreamFactory log you see the error message "SQLSTATE[HY000] [1040] Too many connections", all of MySQL's available connections have been exhausted. If you're in control of the MySQL server, you can change the maximum allowable number of connections by modifying the max_connections system variable. If you're using a cloud service provider such as Amazon's RDS, the max_connections variable cannot be changed and you'll need to resize your RDS instance to handle the additional traffic. For instance, a t2.micro instance can handle a maximum 66 simultaneous connections. A t2.small can handle 150. A t2.medium can handle 312.
 +
 
 +
Consider picking up a copy of [[https://www.amazon.com/High-Performance-MySQL-Optimization-Replication/dp/1449314287 High Performance MySQL]] to learn more about MySQL tuning.

Latest revision as of 15:54, 9 April 2018

Performance Considerations

DreamFactory is a web-based PHP application, and as such its performance will in part be determined by the hosting server's configuration. We recommend using the latest PHP release along with the [NGINX] and [PHP-FPM], all of which should be available or installable on any capable hosting service.

Several server monitoring tools exist for helping you tune your NGINX and PHP-FPM installations, the most notable being [Amplify].

Load Testing Your DreamFactory Environment

We recommend periodically load testing your DreamFactory environment during the development phase. You can choose from an array of load testing services such as [loader.io], or using load testing software such as [Apache Bench].

Performance and Scripted Services

DreamFactory supports the ability to create script-driven services using JavaScript, Node, PHP, and Python. We recommend using PHP-based scripted services for performance reasons, because PHP will necessarily use the [exec()] function to invoke the external program interpreter required to run JavaScript, Node, and Python scripts. Due to the way exec() works, a significant reduction in system performance will be incurred due to the creation of a new shell every time exec() is invoked.

Performance and Database Services

Like any other database-driven application, the performance of database services (MySQL, PostgreSQL, Oracle, etc.) will heavily depend upon the underlying database's tuning. Most notably, you should take care to properly index all tables used in conjunction with the service!

MySQL Considerations

If in your DreamFactory log you see the error message "SQLSTATE[HY000] [1040] Too many connections", all of MySQL's available connections have been exhausted. If you're in control of the MySQL server, you can change the maximum allowable number of connections by modifying the max_connections system variable. If you're using a cloud service provider such as Amazon's RDS, the max_connections variable cannot be changed and you'll need to resize your RDS instance to handle the additional traffic. For instance, a t2.micro instance can handle a maximum 66 simultaneous connections. A t2.small can handle 150. A t2.medium can handle 312.

Consider picking up a copy of [High Performance MySQL] to learn more about MySQL tuning.