Hi all

I had a experience of a website coded in PHP. that was a student result database site. specially used for publishing national certications exam in my country. the results are used to publish at a fixed date that was pre-defined. So the site got a lot of access request from clinets or searchers. in this situation the site fails to fetch the result for individual requests. why did this happens? that is why i have rised that question!


1. was this occur for low bandwidth of the lines?
2. was this happened for database server limitations??
3. may web server included for this problem?

thanks indetail.

Member Avatar for TKSS

Some PHP sites allow only a certain number of concurrent connections (mysql) before it won't render the php on the page anymore. You are also correct... webserver limitations come into play.

Hello billah_norm,

1. What is the genre of message. Timeout error, errors of connection acces inside the result of the web page, ... ?

2. Where are from the error ?
Client => transport => apache => PHP => MySQL

a. If the error is a connection timeout
- the number of apache server
- low bandwith
- server orverload (?)
etc
b. If the error is on the php result that mean a problem to connect the database

see you,

fpepito

Thanks fpepito,

i am not sure of this. because I have no authority or not administrator on this site i mentioned.

But i Think this kind of error came from the unexpected threads that exit the thread limitaion. Most probably I know that threads are controlled by web servers. That is a web server accepts how many numbers of threads for a script simultaneuosly. If the script like as follow:

<?php
  //database conectivity codes here
  $query=select * from table_name; //fetch statement
  mysql_exec($query);
?>

then what may occur??

1. first of all web browser sends request to web server. in response web server will grant for that request and make an execution for that script.
a. If only one request in a given time, the script will fetch the informations
and sends it to the browser via web server.
b. If there multi request occur at a given time,
multi thread will considered by the web server. In this situation two
things may occur:
i. How many threads will be accepted by the web server
simultenuously? it should be considered....
ii. If the multithreads are accepted simultenously then comes the
questions for the SQL server connectivity
.
c. Furthermore it will be considered for the bandwidth time limits as time
errors or others related with this.

My questions were for the case of 1(b):
aa. How many threads are defined to be accepted by the web server? or
is it even possible to define the number of threading acceptance?

bb. How many connectivity may define by the SQL server? Is it possible
to define this connectivity or not?

cc. Is it fair to consider PHP Scripts for these concepts? If it is then
How?

Thanks you again and thanks to TKS

See you all

Hi billah_norm,

I have try a brutal test: a maximum of connection in my own computer (linux / apache / PHP / MySQL) with a minimum of timeout (because I am in local) 1 second.

When a send 5000 requests (of two follows scripts)
I obtain 2 type of result file:
1. *** result is correct

2. *** with problem in MySQL Connection
The result with errors are all like this:
<br />
<b>Warning</b>: Too many connections in <b>/home/httpd/html/PHP/connect.php</b> on line <b>22</b><br />
<br />
<b>Warning</b>: MySQL Connection Failed: Too many connections
in <b>/home/httpd/html/PHP/connect.php</b> on line <b>22</b><br />
Unable to connect to SQL server

3. *** with problem in Server Connection
--22:47:59-- http://127.0.0.1/php/test5.php
=> `test635.txt'
Connexion vers 127.0.0.1:80...connecté.
requête HTTP transmise, en attente de la réponse...
ERREUR de lecture (Connexion terminée par expiration du délai d'attente) de l'en-tête.
Abandon.


If your problem is MySQL Connection you while the client while received messages like this "Too many connections".
If your problem is with Server Connections you have error from wget/browser, and nothing on the body of file.

I will continue with tests ... perhaps I will find more :)

see you,

fpepito

########## test5.php
<?
include "/home/httpd/html/PHP/connect.php";
connect_mysql();

$q = "SELECT * FROM fotos_file";
$query = mysql_query ($q);
$res = mysql_num_rows($query);
echo "found $res";
?>


########## test5.sh

#!/bin/bash

rm -f test*.txt test*.log

echo "url: "
read url

echo "nb connection:"
read nb

for i in $(seq 1 $nb) ; do
wget $url -T 1 -O test$i.txt -o test$i.log &
done

Hi fpepito!

thanks a lot!! your informations maked me found a way of going.

1. Why you found correct results in first type while errors occur for the same for second type?
2. Is there any limitation for MySQL Maximum connectivity?
3. I am not sure of your third error message. HTTP server how related with this MySQL connectivity? So far I know HTTP server acts for introducing the midleware language PHP.
WebBrowser <<==>> Apache <<==>> Midlware(PHP,ASP,Perl) <<==>> Database(MySQL)
I will try to test it. and then inform you.

I will eagerly witing for your further test results

thanks again.
see ya

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.