Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

PHP - AJAX - why is file access sequential - No Sessions

Posted on 2012-03-28
4
Medium Priority
?
395 Views
Last Modified: 2012-06-27
I have a php file that acts as a gateway to an application server. The php file acts as a connector, it collects values from the request and opens a socket to send a msg to the application server, and then echoes back the returned response - generally some HTML.

The process works correctly, however an individual user can only send requests in serial manner, ie one request to the php file must complete before the next queued request is executed. However multiple users can access the same file, and two simultaneous requests from two different browsers from the same PC will also work.

We are not using any php session management as the application server handles all of that.

I am confused as to why I cannot execute multiple calls to the same file from a single connection/'session'.

As a footnote, the PHP file used with IIS 7.5 does not exhibit this behaviour an individual connection can access the php file in a con-current manner.

Here are some settings from php.ini

session.save_handler = files
session.auto_start = 0

The environment is Ubuntu Server 10.04.4
PHP Version 5.3.2-1ubuntu4.14
Apache/2.2.14 (Ubuntu) Server built: Feb 14 2012 16:42:25
0
Comment
Question by:kyleitvss
  • 2
  • 2
4 Comments
 
LVL 7

Expert Comment

by:designatedinitializer
ID: 37776124
It could be due to PHP socket blocking, which is ON by default in PHP -- I don't know if in IIS your default is off.
Bu it's probably something in your Apache configuration.
Check the "accept Serialization - multiple sockets" section in this page:

http://httpd.apache.org/docs/2.2/misc/perf-tuning.html

PS: Sessions have nothing to do with it
0
 

Accepted Solution

by:
kyleitvss earned 0 total points
ID: 37779638
I looked thru' that section ( "accept Serialization - multiple sockets") - and it was very interesting however it was a way over my head. However, I did some testing and found that if the URL is made to be unique then simultaneous requests will get processed.

http://<servername>/path/connector.php/test_response?site_id=mysite&uniqueid=11111

http://<servername>/path/connector.php/test_response?site_id=mysite&uniqueid=22222

So its not sessions as you noted - its how Apache handles discrete requests from a browser.
0
 
LVL 7

Expert Comment

by:designatedinitializer
ID: 37779703
that's got be something you can tweak in the conf, though you will surely go about it that way you devised.
0
 

Author Closing Comment

by:kyleitvss
ID: 37815442
Further testing proved the issue was a related to the uniqueness of the URL
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question