Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8099251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:20:44+00:00 2026-06-05T22:20:44+00:00

If I have mutliple, and at the same time, Ajax javascript queries on domain/somefile.php,

  • 0

If I have mutliple, and at the same time, Ajax javascript queries on domain/somefile.php,

where somefile.php must get response from curl request (curl_exec) to domain/somehandler and return them

how is handled parallelism by Apache2?, Is it really slower than if I was doing the Ajax queries directly on domain/somehandler?

thx for explanations

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T22:20:46+00:00Added an answer on June 5, 2026 at 10:20 pm

    how is handled parallelism by Apache2? – In terms of Apache there is no real problem, unless you have configured it really badly so that it does not have enough processes/threads to handle the load. It’s more about hardware resources and network bandwidth than anything else. The thing to watch out for here is nothing to do with Apache and is actually related to PHP sessions which I will explain below, but first…

    Is it really slower than if I was doing the Ajax queries directly on domain/somehandler? – Yes, inevitably. This is because you have immediately doubled the number of HTTP requests required to complete the transaction. You have also increased the amount of bandwidth and overall CPU time required. Whether it will be noticably slower and whether it will cause you a problem depends on a thousand factors about exactly what you are doing, how you set up your cURL script, how fast the network link is between the two back end servers, etc, etc, etc…


    The answer to the question that comes up here again and again relating to concurrency issues with PHP driven applications is related to Sessions. Many sites use sessions to track user data, login status, all sorts of information and there is nothing wrong with that per-se (although they should be avoided if at all possible and are completely incompatible with REST), but it can cause concurrency problems if they are not handled correctly.

    The reason for this is that PHP stores the data for a session in a file in the local file system of the server. While a session is open, the file is locked to prevent corruption of the session through concurrent writes. This means that a second request that attempts to utilise the session file will “block” (i.e. wait) until the first has released it’s lock on the session file.

    Most of the time people do not notice this, the most common thing I have seen here is people who are attempting to serve a file download through a PHP-based servlet script, and they leave the session file open while the file is sent. This causes the user to be unable to load any pages from the site while they download the file.

    The problem can be easily avoided by calling session_write_close() as soon as you have finished with the session data.

    …although of course if you’re not using sessions, none of this will affect you anyway.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to have multiple scripts running from cron at the same time. They
I have multiple threads, executing similar queries. They shouldn't be executed the same time.
I have been trying to do something like below. JavaScript $.ajax({ url: 'login.php', type:
I have multiple ajax forms on page that cointain same elemets, I have jquery
I have multiple BIRT reports that obtains the data from the same jdbc data
I have multiple actions running at the same time. When Action 1 is finished
I have multiple feeds, how do i load them at the same time with
From http://en.wikipedia.org/wiki/AJAX , I get a fairly good grasp of what AJAX is. However,
i am sending multiple ajax requests at a same time as ajax sends Asynchronous
I have a PHP/jQuery/AJAX/MySQL app built for managing databases. I want to implement the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.