Chapter 10 Achieving Optimum Performance with PowerDynamo
PowerDynamo can preallocate an HTTP response page size buffer.
Previously, for buffer appends, PowerDynamo would reallocate a new
buffer, copy the previous buffer and then append new output to the
response buffer. This proved time consuming, especially when generating
a dynamic page from a loop with multiple calls to document.writeln
methods.
The document.write*
family
of functions has been significantly improved with the preallocation capability.
You can configure the default preallocated response buffer size
and the algorithm that PowerDynamo uses to preallocate page buffers
after the first execution of the request. These properties allow
you to tune the preallocated response buffer size. Ideally, the
preallocated size allows Dynamo to append to the end of the buffer
without reallocating a new buffer. Use the Sybase Central Default
General Settings option to configure these properties:
You can tune these settings to increase overall performance. The preallocated response buffer size should closely match the actual response size in most cases. Consider the case of a request that returns response sizes described in Table 10-1:
Request number | URL | Response size |
---|---|---|
1 | http://localhost/Site/dyn_page.stm?loop_count=5 | 5,000 |
2 | http://localhost/Site/dyn_page.stm?loop_count=10 | 10,000 |
3 | http://localhost/Site/dyn_page.stm?loop_count=2 | 2,000 |
4 | http://localhost/Site/dyn_page.stm?loop_count=3 | 3,000 |
These results are an example of how response size can vary for pages that write content in a loop, such as a page that prints rows from a database query. Table 10-2 lists preallocated buffer sizes using the maximum page size strategy:
Request number | Preallocated sizes | Actual response size |
---|---|---|
1 | 20,000 | 5,000 |
2 | 5,000 | 10,000 |
3 | 10,000 | 2,000 |
4 | 10,000 | 3,000 |
Table 10-3 lists preallocated sizes with the average page size strategy:
Request number | Preallocated sizes | Actual response size |
---|---|---|
1 | 20,000 | 5,000 |
2 | 5,000 | 10,000 |
3 | 7,500 | 2,000 |
4 | 4,750 | 3,000 |
Table 10-4 lists preallocated sizes using the minimum page size strategy:
Request number | Preallocated sizes | Actual response size |
---|---|---|
1 | 20,000 | 5,000 |
2 | 5,000 | 10,000 |
3 | 5,000 | 2,000 |
4 | 2,000 | 3,000 |
Copyright © 2001 Sybase, Inc. All rights reserved. |