Parallel processing for web requests

The newest release of Nephtali takes a new approach to parallel processing.

In the earlier releases, Nephtali made it easy for the developer to make any pipe process in parallel, but this came at a great cost to the server.  Running a fast server, this would still lead to better page-load times.  However, if resources were limited, this could quickly spiral into a heavy load that actually hurt performance.

Current releases make the following assumptions about parallel processing:

  • Web service requests stand to gain the most from parallel processing given Nephtali’s use of CURL to achieve it, as breaking off separate requests for direct queries to a DB can actually impede the servers performance under heavy load.
  • Htmlfrag requests using Nephtali’s REST-ful API involve individual pipes that typically use one web service call, so parallel processing isn’t nearly as important (although you could implement the parallel requests on your own if you have a pipe that needs this performance.)

The new capabilities allow you to register requests (e.g., n\curl\request\register($url, $post_data = array(), $connect_timeout = 1, $transaction_timeout = 2)) and then retrieve responses in whatever pipes need them (e.g., n\curl\response\get($url)), making it easy to improve the performance of any pages that makes multiple requests to web services.  All requests are processed in parallel before any pipes during standard requests.

If you use the REST-ful API to retrieve an htmlfrag request for a pipe, the request will happen in real-time (i.e., it won’t already have happened in parallel before any pipes are processed.)

This entry was posted in New Feature, Performance. Bookmark the permalink.

One Response to Parallel processing for web requests

  1. Pingback: Nephtali web framework creator talks FP | Davin's blog

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>