Solved

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

Posted on 2012-03-28
4
382 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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.
This article discusses four methods for overlaying images in a container on a web page
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now