Hi folks, stackoverflow,
A bit of background
My PHP is installed on Windows 7 com using IIS and I am implementing web.config and the version of SQL Server (mssql) is 12.0.
The site I built has a theoretical three-tier architecture, that is, I tested using 2 com with one lump containing mssql and web levels, and the other with the application level.
therefore, when a user connects, he connects like this:
[user com] --request page--> [web tier] --request info--> [app tier] --get info--> [mssql tier]
im using the PHP cUrl function to send requests to the application level, which looks something like this:
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POSTFIELDS, $xml); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERAGENT, 'curl'); curl_setopt($ch, CURLOPT_TIMEOUT, 5); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: close')); $result = trim(curl_exec($ch));
plagiarising this question a bit.
sometimes I use the $ .ajax call to get material from the web tier, like reviews or posts.
A typical page contains perhaps 10-20 calls to cUrl.
Problem
The problem is that the site continues to freeze after three or four pages (this is random, but usually in this range), or the page does not load everything (what, in my opinion, is this related to the curlopt_timeout parameter? Explanation is required) and I have to restart IIS server. I determined that this is a cUrl function that continues to freeze com.
I am looking for several months for a solution, but after about 20 different solutions I am on my way. I don't know why cUrl freezes the entire IIS (the entire local hot site freezes), and I have no idea why it keeps coming back even when I copied the whole site to another com (it got worse).
When I tested the thing on 2 computers (see above), the site loaded very slowly. obviously due to cUrl.
I hope someone can shed light on what is happening and, if possible, solve the problem.
Thanks to the stackoverflow community.
Additional Information
If this helps to solve the problem, all cUrl requests go into one php file at the application level dbQuery.php, which reads the input and loads the desired page in the mssql table, receives or passes any information and returns mssql leads to xml. (im thinks this could become a bottleneck as the largest page caused 37 cUrl calls).
Update
This morning (03/26/2012) I tried to reduce the number of calls to cUrl, and website performance improved. but freezing still occurs though: \