You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Henri Laupmaa <he...@inspiral.net> on 2000/10/05 03:35:10 UTC
random function
I get a strange error when calling a random function - it starts
sending back broken pages when load testing, but while just
loading/reloading it works
The results of the load test:
Document Length: 5064 bytes
Concurrency Level: 30
Time taken for tests: 14.279 seconds
Complete requests: 30
Failed requests: 27
(Connect: 0, Length: 27, Exceptions: 0)
Results with random function removed:
Document Path: /index.html?
Document Length: 29859 bytes
Concurrency Level: 30
Time taken for tests: 22.808 seconds
Complete requests: 30
A simple omission?
Any help welcome,
Henri Laupmaa
Inspiral Network
+372 55 24542
Re: Execute (was: random function)
Posted by Gerald Richter <ri...@ecos.de>.
>
> Btw. do multiple 'execute' functions get called in parallel when done
> in one embperl file? eg. when I have 5 files included in index.html
> via Execute could they start accessing db at the same time?
>
No, Execute's are execute in the order they appear in your sourcefile
> If so - is there an option to have a simple 'include' so the embperl
> parser runs the final code as if it was contained in one file?
>
> Or is the only way to move all the included files into one?
>
You can specify a package name to Execute, to let them all execute in the
same namespace, which is nearly the same, as first including them and then
parsing them, but it will take up extra memory, because the include files
are compiled in every namespace of every page that calls them.
Gerald
-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925151
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
Re: random function
Posted by Henri Laupmaa <he...@inspiral.net>.
On 4 Oct 2000, at 21:30, ___cliff rayman___ wrote:
> i'll take a late night stab at it.
> which random function are u using and where is it getting its randomness? i know some of them will just block if there is nothiing to produce entropy. perhaps apache is timing out and that is where the broken pages are coming from.
Simple rand() function.
Index.html calls via [- Execute() -] a separate file which performs
one random call and on database update.
Btw. do multiple 'execute' functions get called in parallel when done
in one embperl file? eg. when I have 5 files included in index.html
via Execute could they start accessing db at the same time?
If so - is there an option to have a simple 'include' so the embperl
parser runs the final code as if it was contained in one file?
Or is the only way to move all the included files into one?
TIA,
Henri Laupmaa
Inspiral Network
+372 55 24542
------------------- The main function in the included file
[-
srand();
$random = int(rand($maxnr));
$banner = &CONCOM::sql("SELECT * from banner where
tyyp=$tyypid limit $random,1;");
$id = $$banner[0][0];
$link = $$banner[0][2];
$img = $$banner[0][3];
$view = ($$banner[0][6])+1;
&CONCOM::sql("UPDATE banner set view=$view where
banner_id=$id;");
-]
Re: random function
Posted by ___cliff rayman___ <cl...@genwax.com>.
i'll take a late night stab at it.
which random function are u using and where is it getting its randomness? i know some of them will just block if there is nothiing to produce entropy. perhaps apache is timing out and that is where the broken pages are coming from.
i am sure the gurus on this conference will need more info to debug this problem. can u post the smallest possible script that will reproduce this error?
--
___cliff rayman___cliff@genwax.com___http://www.genwax.com/
Henri Laupmaa wrote:
> I get a strange error when calling a random function - it starts
> sending back broken pages when load testing, but while just
> loading/reloading it works
>
> The results of the load test:
>
> Document Length: 5064 bytes
> Concurrency Level: 30
> Time taken for tests: 14.279 seconds
> Complete requests: 30
> Failed requests: 27
> (Connect: 0, Length: 27, Exceptions: 0)
>
> Results with random function removed:
>
> Document Path: /index.html?
> Document Length: 29859 bytes
>
> Concurrency Level: 30
> Time taken for tests: 22.808 seconds
> Complete requests: 30
>
> A simple omission?
>
> Any help welcome,
>
> Henri Laupmaa
> Inspiral Network
> +372 55 24542
>
>
--
___cliff rayman___cliff@genwax.com___http://www.genwax.com/
Re: random function
Posted by Gerald Richter <ri...@ecos.de>.
> I get a strange error when calling a random function - it starts
> sending back broken pages when load testing, but while just
> loading/reloading it works
>
Any errormessages in the error.log or in the embperl.log file?
Gerald
-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925151
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------