Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2012-03-28
4
Medium Priority
?
394 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
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…
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.

688 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