Below is a chart comparing server performance in 3 cases : Baguette AMF Server, AmfPHP with Baguette AMF and Amfphp without Baguette AMF.
Baguette AMF Server gets the best performance in all cases. This is because Baguette AMF Server, concentrates on the essentials, and leaves aside the modularity and non-essential features of Amfphp.
Next, compare Amfphp with and without Baguette AMF: It’s only with large amounts of data that Baguette AMF makes a real difference. This is because in the case of small amounts of data much more time is spent in the rest of the PHP code than in converting . However, with large amounts of data, conversion is the real bottleneck, and this is where using Baguette AMF with Amfphp shines.
Run the tests yourself
You will need:
- A server with the Baguette AMF extension installed
- A fresh copy of Amfphp
- To be able to build the Flex project. If you don’t use Flex, you can create your test service call yourself, it will just be a bit more work.
- A packet sniffer that can repeat requests to simulate load. Here Charles Proxy was used.
Please Download the Project Zip. It contains:
- TestService.php. A test service with a “returnLargeDataSet(numItems)” method. The service returns an array of items whose length is determined by the numItems parameter. Each item contains a randomly generated integer, float, and string.
- The Flex code, and a Flash Builder project. When built it will provide you with a user interface to generate single requests to “TestService.returnLargeDataSets” with varying values for numItems. Put your server url(s) in the included xml file.
- The Excel file used to generate the chart.
To run the test, create sample requests that can be captured with the packet sniffer. Then use the packet sniffer to repeat the request repeatedly and with concurrency.
The packet sniffer should be able to indicate the number of requests per second handled by the server(requests/sec in the overview on the right)
You should get similar results to those posted above! Please feel free to share your findings.