Installation guide
From the PHP documentation
This defaults to on, forcing APC to stat (check) the script on each request to determine if it has been modified. If
it has been modified it will recompile and cache the new version. If this setting is off, APC will not check, which
usually means that to force APC to recheck files, the web server will have to be restarted or the cache will have
to be manually cleared. Note that FastCGI web server configurations may not clear the cache on restart. On a
production server where the script files rarely change, a significant performance boost can be achieved by
disabled stats.
For included/required files this option applies as well, but note that for relative path includes (any path that
doesn't start with / on Unix) APC has to check in order to uniquely identify the file. If you use absolute path
includes APC can skip the stat and use that absolute path as the unique identifier for the file.
Use Composer with a classmap autoloader
Using Composer is the recommended way to install the AWS SDK for PHP. Composer is a dependency manager for
PHP that can be used to pull in all of the dependencies of the SDK and generate an autoloader.
Autoloaders are used to lazily load classes as they are required by a PHP script. Composer will generate an
autoloader that is able to autoload the PHP scripts of your application and all of the PHP scripts of the vendors
required by your application (i.e. the AWS SDK for PHP). When running in production, it is highly recommended that
you use a classmap autoloader to improve the autoloader's speed. You can generate a classmap autoloader by
passing the -o or --optimize-autoloader option to Composer's install command:
php composer.phar install --optimize-autoloader
Please consult the Installation guide for more information on how to install the SDK using Composer.
Uninstall Xdebug
Xdebug is an amazing tool that can be used to identify performance bottlenecks. However, if performance is critical
to your application, do not install the Xdebug extension on your production environment. Simply loading the
extension will greatly slow down the SDK.
When running on Amazon Linux, Xdebug can be removed with the following command:
# PHP 5.4
yum remove php54-pecl-xdebug
# PHP 5.3
yum remove php-pecl-xdebug
Install PECL uri_template
The SDK utilizes URI templates to power each operation. In order to be compatible out of the box with the majority
of PHP environments, the default URI template expansion implementation is written in PHP. PECL URI_Template is
a URI template extension for PHP written in C. This C implementation is about 3 times faster than the default PHP
implementation for expanding URI templates. Your application will automatically begin utilizing the PECL
uri_template extension after it is installed.
pecl install uri_template-alpha
Turn off parameter validation
The SDK utilizes service descriptions to tell the client how to serialize an HTTP request and parse an HTTP
response into a Model object. Along with serialization information, service descriptions are used to validate operation
inputs client-side before sending a request. Disabling parameter validation is a micro-optimization, but this setting
can typically be disabled in production by setting the validation option in a client factory method to false.
$client = Aws\DynamoDb\DynamoDbClient::factory(array(
'region' => 'us-west-2',
Performance Guide
44