phpactionscript-3amfphp

Does the number of remote requests affects performance?


I have a photobook making site and i'm trying to improve loading and saving performance.

The photobook making tool is displayed in a web browser, is done in Flash, and the remote calls for database operations are done through AmfPhp.

The algorithm for saving a photobook basically says:

foreach(page in photobook){
    foreach(component in page){
        //Make a remote call that saves the component in the Database
    }
}

This means that if a photobook has 30 pages, with 10 components(photos) per page, the tool will create approximately 300 simultaneous connections without counting the uploads connections.

Firefox for example, seems to all ready create a queue to process the requests.

Does this affects the performance at all?

Will it help to create a queue that controls the number of simultaneous remote calls?

Is it worth it?

Thank you for any help you can give me.


Solution

  • Every request to remote server will result in time increase for your script execution.

    3 queries to database are faster then 3 remote requests.

    So yes your performance will be heavily impacted with 300 remote requests.

    Best solution is to either paginate, or serialize all of data in XML. Though careful with XML, if too big it will cause performance issue as well.

    I think pagination is the best option.