Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Can My Server Take The Load Of This Thumbnail Generator?


My server: Shared VPS
Centos 4
Equal share CPU
1GB Burst RAM
256MB RAM

My question: I have a .php file generate thumbnails on the fly. I have a moderate amount of traffic. Sometimes the gallery(s) shown can list up to 20 or so images, with fairly large thumbnails. Am I causing uneccessary server load by not just making my own thumbnails and having all these galleries generated on the fly?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Thumbnail Generator
Does anyone have a demo to look at for a very simple thumbnail generator for a jpg image? If a user uploads a jpg, and then a thumbnail is made of it.

Load Image When Thumbnail Is Clicked?
i have a big website redesign release due in a matter of days, and the guy who was doing the CSS piked out now im doing my best going solo
even though it means having tables based php pages...

MY DILEMA:

On the 'art' content page i had planned to have an array of small thumbnails that, when clicked, would each tell the page to load a specific image
in the area (a table or whatever works) as is shows in the image where there is a white box. hopefuly the dark grey area that the image would load in, would expand and shrink (vertically) as needed (as all images would be under the horizontal limit anyway)...

i would want the next image to load, to replace the previous image...

is this doable? what is the bes/most effective way of going about this?

Server Load; Script Vs DB
I'm currently using a very basic script that takes the requested URI and determines where to redirect the user based on it's content, it simply uses a case statement with approx 20 options.

My only concern with this particular application is server load (high traffic) and I'm wondering if using the plain script or using a MySQL DB to find the target URL's would be better.

Reducing Server Load
I've got a script that I've released as open source. A user recently reported to me that their host has complained that it's using too much of the server resources. He says that it occasionally jumps up to 15% memory usage, and the CPU usage up around 1.5-2.5. This is on a Celeron 2.2gHz with 512 of RAM. He reports getting around 900 unique visitors a day.

I'd like to do what I can to improve the script to make it not so heavy on server load, but am not quite sure what to do to improve it. All of the appropriate fields are indexed, and when doing queries, I always call the specific columns and don't use SELECT *. Anyone got any other suggestions?

PHP Include And Server Load
I'm building a site that could in theory be divided into several includes. My concern is that some pages could end up having nothing but the header and includes. Should I avoid having "X" number of includes?

Server Load Benchmarking
I've built my php-enabled page. There are logins/logouts, blob queries to a mysql database. Now I'd like to see if this thing is efficient let's say at 50 hits/sec. (watching the cpu utilisation on a page reload isn't really good....) Does anyone know how to benchmark for such a task?

Server Load Averages
There are a fairly large collection of PHP scripts that will pull the server load averages calculations from a Unix server, but I am running my Apache server on XP (I know, not the best combination, but it's what I have to work with)

Is there any way of getting a load averages calculation (or something similar) on and Apache Server running under XP?

How Many Session Variables To Use?? (server Load)
I was just wondering that if one uses sessions then it's the server which is keeping track of all session variables for all users. right? So if this is the case then if a site is using say 20 session variables(per user), won't this increase the load on the server? keeping this in mind.. what would be the limit on the number of session variables... assuming that each variable is a string of no more than 6 chars.

And is there anyway to check what the server load is?? i'm running apache on WinXP.

Server Load/Number Of Queries
How are these two things accounted for? Like how can I print how many queries I have used, or how much a script is adding to the server load?

Automail Script, Will This Load Server ?
I have an educational website which sends lessons to users automatically according a schedule. A cron job runs distribution script everynight at 12:00.

1- Does a loop over all profiles to see if any of them has reached its next message time.

2- Opens lessons database and extracts lesson text (something arround 10K-15K)

3- sends lessons with PHP's mail function (which needs a little time to resolve host I think)

Questions:

1- Will this script load the server if I gave arround 500 active student profiles at a time? (I am on a shared server)

2- I had written script in a way that all lessons were in individual physical files but i thought database records are faster and make less server load. Is this true?

3- I send each individual mail using mail() function. Is there a way to send mails with less server load? What do listservers when they want to send emails to say 1000 addresses?



Cannot Load Libphp4.so Into Apache 1.3.12 Server
I have religiously followed the instructions for installing PHP4.0.1pl2 as a dynamic module in Apache 1.3.12. When I try to restart Apache, though, I get warned that:

Cannot load /usr/local/apache/libphp4.so into server: /usr/local/apache/libphp4.so: undefined symbol: uncompress

Has anybody else run across this problem?

PHP Versus Perl For Server Load?
I've read comparison of Perl vs. PHP regarding features and coding, however
I would like to know how each affects server load.

I am looking at two scripts - one in Perl and the other in PHP - for the
Amazon Product Feed. My understand is that Perl must be compiled on each
execution and that PHP does not, therefore PHP is less of a load on the
server.

PHP Script Increase Server Load, What To Do?
I have built a php script and am using it on my apache server (php version 4 and red hat linux).

The problem that I am facing is that whenever I use the "top" command via ssh on my server, it shows a stuck httpd request due to these php scripts. The request remains stuck for an unforeseen time, increases memory usage and thus increases server load and processing power. Not just 1, there are several such httpd requests running for a very long time and I could say that they terminate only when I do a apache restart.

Prevent DB Timeout Caused By Server Load
Is there any way to prevent mysql from timing out after 60 seconds without a connection? I am having trouble with php pages taking a long time loading on my web host. I called them, but they said it was a temporary overload on my domain. The thing is, temporary doesn't seem temporary; it seems like a lot longer then that.

So does any one know a way to display database content with mysql after 60 seconds with no connection? I'm sure the answer probably is "no", but I figure it would not hurt to ask.

User Uploading Files To Load Balanced Server Cluster
This really is a file permissions problem ... although I'm not sure how
to solve it. Any assistance would be greatly appreciated.

I have a series of load balanced servers. Each of the servers is
arranged exactly the same and handles file uploads from users as
follows:

1) User submits file to www1 server
2) www1 server saves file with permissions showing user "www" is the
owner, dir owner is the group for the file ("sg" in this case).
3) cron script on www1 scp's the file to www2 server.

All of this works great up until the following happens ...

4) User resubmits the file to www2 server
5) www2 attempts to update file located on www2 server with new
version, but cannot modify file (attempting to overwrite a file owned
by sg/sg with a file to be owned by www/sg).
6) User continues to see old image, new image is not replicated

Query Runs Multiple Times Under Heavy Server Load.
I have been having an issue with some MYSQL queries running multiple times when the server is under a heavy load. 

Example, if I do an 'update Table1 set item1 = 0 where 1 = 1'

This runs fine under normal conditions, but will repeat itself multiple times when the server is under load.  Is this just an optimization or server resource issue.  If so, I would assume the query would just timeout and not run at all instead of running a few times.

How Can I Load Load Additional Extensions ?
My OS is Winxp . My web server is apache 2 which is installed as a NT
service .

My php version is 4.32 , and I extracted it into "c:php" .

I run php as a apache module .

I want to load Additional extensions .They are php_mbstring.dll,
php_xslt.dll and php_domxml.dll .

I have made changes to php.ini as follow.
extension_dir = "c:phpextensions"
extension=php_mbstring.dll
extension=php_xslt.dll
extension=php_domxml.dll

then I restarted apache2 .

but it told me that the modules could not be located .

Name Generator
I’m going to be creating a username generator that gives you a few usernames you could use, based on the one you asked to have but was taken.

For example, when you signup for a hotmail account and the e-mail address you specified is already taken, it gives you a few choices to pick from based on DOB, age, etc., or create your own custom one again.

The thing I’m going to be making is very similar. Instead stead of generating some names based on your DOB, age, etc. it will just give some names with numbers added on, or whatever the guy I’m making it for wants it to operate. Like I enter in Epsilon and it is taken, it then gives me something like Epsilon2002 (Based on the current year), Epsilon_, Epsilon- and so on.

Password Generator ?
I want the password to generate a 8 character long and the password is A-Z, a-z, 0-9.

Looking For A PHP PIN Number Generator
I am looking for a script that generates PIN Numbers.

Is there one available somewhere out there? I don't mind algorithms if
they will be easy to implement in PHP.

Site Generator
Has anyone got any scripts that will, after a person registers, it will automatically create a directory for them?? Example:

User Registers -> Confiration Page -> User may now go to
http://mydomain.com/registeredusername with a default index.hml file

Also a File Manager. Does anyone know how to do this or where i can find such a script?

Code Generator
Does anyone knows a code generator for Php ?
Actions to do: specifiy a mysql table and their fields, and build a default
webpage which allows to add,update,delete,search, browse, print the table
data.

Site Map Generator
i was just wondering would it be possible to create a site map, where by you enter a URL and then it searches through the site and outputs this on a page. I know I've used a package which does this, but interested to see if it can be done using PHP?

Random Generator
This might seem a stupid question but here goes -

I wrote a key generator for one of my programs in Visual Basic, so I recieve
sales notification via email and then use my program to generate the key and
send it via Email.

Well after finding out about PHP, and that my host does PHP, I thought it would
be quicker and more reliable to generate the keys on the server and send them
out again either vai email or from the sales site.

So I wrote the generator in PHP and surprisingly it works, or rather it works
in a half assed fashion, I can generate keys, but they are not the same as the
ones generated by my VB program.

And here is my problem, I suspect its becuase I'm using a randomised Seed, and
I'm thinking that VB and PHP Randomisers are not compatable.

Am I right in my thoughts and if so, is there a way around it?
Is the only answer not to use a randomiser? or how do people generate keys from
the server when using other languages ie C++ etc?

Quiz Generator...
I have been doing through the web to search for a test/exam quiz generator that generate quiz, test and provide statistics. Most of them are commerical. Are there open source program for it in php?

Standalone Sig Generator
I currently have my sig generator running,  the problme Im facing is that it outputs like this http://mysite.com/image.php?sigimage.png

I need to have it out put like this -> http://mysite.com/image.png?sigimage.png or something like it because a lot of sites do not allow image.php. Code:

PHP Screenshot Generator
Does anyone know of any real-time screenshot generator? Where you can give the PHP file a URL and it will convert that URL page into a JPEG image with GD?

I have had a look around and only found a few but none seemed to do this job.
Anyone?

Table Generator
I have this way of getting a webpage to include a table from a comma
separated file. Works well for purpose I have used up to now but wish to
extend it to generate a table with a top row of cells of type th.
So two questions about this:

1. What exactly should the code be to enable this and
2. How should the csv file be formatted (if different from normal comma...

Password Generator- Unique?
I have a script that is supposed to generate unique passwords. Trouble is its producing passwords that already exist in the 'personaldetails' table. i don't think I'm the lucky type that wins the lottery everyday so it its not by chance - there is an error somewhere. (the userid is primary key and is autoincrement, I know thats not a standard way of doing it but that isn't causing this error)
The script is:

if ("SUBMIT"==$generate){
$String = "This is the text which will be encrypted so that we may create random and secure passwords!";
$Length = 8; // Change this value to indicate how long your passwords should be. 32 character limit.
$String = md5($String);
$StringLength = strlen($String);
srand ((double) microtime() * 1000000);
$Begin = rand(0,($StringLength-$Length-1)); // Pick an arbitrary starting point.
$password = substr($String, $Begin, $Length);
print ("Your recommended password is:<P><BIG>$password</BIG>
");

// Add the password to the database.

$sql = "INSERT INTO personaldetails SET " .
"firstname='$firstname', " .
"surname='$surname'," .
"password='$password'," .
"teacherstatus='$teacherstatus'";
if (mysql_query($sql)) {
echo("<P>Your password has been added to the database.</P>");
} else {
echo("<P>Error adding password to database: " .
mysql_error() . "</P>");
}
$Query5="SELECT userid FROM personaldetails WHERE password='$password'";
$result5=mysql_query($Query5) or die ("Can not execute query:" . mysql_error());
print("Your userid is " . mysql_result($result5,0) . ". This has also been added to the database. ");
}

I don't understand why its not generating unique passwords. As, a consequence I'm bringing back the userid for the password that was already in the table, I end up with 2 people sharing the same password and and the generator reports they have the same userid ( when I look in the table the newest row has been added and has a userid which is different to the userid of the other person in the table who has the first copy of the password. My query to bring back the userid is bringing back the userid of the first row it comes to that has the 'unique' password entry, unfortunately the password is not unique and so I get the wrong persons userid? - can you spot what is wrong with the generator?

Random Number Generator
<?php
function get_random_number_between($start, $end) {
srand((float)microtime()*1000000);
$random_number=rand($start,$end);
return $random_number;
};
echo get_random_number_between(2, 4);
?>

Could anyone suggest how to modify this code to output a float between 2 and 4 with 2 decimal places?

Password Generator- Unique?
I have a script that is supposed to generate unique passwords. Trouble is its producing passwords that already exist in the 'personaldetails' table. i don't think I'm the lucky type that wins the lottery everyday so it its not by chance - there is an error somewhere. (the userid is primary key and is autoincrement, I know thats not a standard way of doing it but that isn't causing this error)

The script is:

if ("SUBMIT"==$generate){
$String = "This is the text which will be encrypted so that we may create random and secure passwords!";
$Length = 8; // Change this value to indicate how long your passwords should be. 32 character limit.
$String = md5($String);
$StringLength = strlen($String);
srand ((double) microtime() * 1000000);
$Begin = rand(0,($StringLength-$Length-1)); // Pick an arbitrary starting point.
$password = substr($String, $Begin, $Length);
print ("Your recommended password isP><BIG>$password</BIG>
");

// Add the password to the database.

$sql = "INSERT INTO personaldetails SET " .
"firstname='$firstname', " .
"surname='$surname'," .
"password='$password'," .
"teacherstatus='$teacherstatus'";
if (mysql_query($sql)) {
echo("<P>Your password has been added to the database.</P>");
} else {
echo("<P>Error adding password to database: " .
mysql_error() . "</P>");
}
$Query5="SELECT userid FROM personaldetails WHERE password='$password'";
$result5=mysql_query($Query5) or die ("Can not execute query:" . mysql_error());
print("Your userid is " . mysql_result($result5,0) . ". This has also been added to the database. ");
}

I don't understand why its not generating unique passwords. As, a consequence I'm bringing back the userid for the password that was already in the table, I end up with 2 people sharing the same password and and the generator reports they have the same userid ( when I look in the table the newest row has been added and has a userid which is different to the userid of the other person in the table who has the first copy of the password. My query to bring back the userid is bringing back the userid of the first row it comes to that has the 'unique' password entry, unfortunately the password is not unique and so I get the wrong persons userid? - can you spot what is wrong with the generator?

Form Generator Or Class / OSX
i am sure we all know this Problem, u build a website and want to implement a CMS, so that the content can be updated easily. So u spend half a day building Form Sets for Update insert delete etc..

Does anyone here know of a good form generator that will build this forms automaticly? Best would be a Class or something but a desktop version that runs on OSX would be great too.

PHP File Map Generator/editor
Is there some software that can map the file tree (mainly the file includes within the PHP scripts) and create a tree to show where these files are included, and from which files. Rather like UML for c and c++ kind of function?

Database Or File For Name Generator ?
I am making a random name generator, it will pick two or three words
from a list and turn them into a name. It seems a database needs to
work with name/value pairs, so am I right in thinking for a simple
list, seperated by line breaks, a file is the most sensible choice ?
If so, what happens if someone else tries to write to the file whilst
I am working with it ?

Random Signature Generator
I'm trying to find a script for use on vB that will randomly generate a banner image (from a few images that I select in advance) when it loads in my signature. I've seen them at work, but can't seem to find them on, say, yahoo, or google.

Class Or Function For A Key Generator?
I need to be able to produce a string consisting of uppercase letters and numbers. I would also like it to produce e.g. a string of 6 characters all the time. A given number must allways result in same string such as "AE4YX8". Would also be nice if I could go from the string to the original number as well. Anyone with links to sites with example on how to do this?

Wanted: PHP Site Map Generator!
Having spent my free time over the last few months converting several
hundred pages of mainly static (s)html into eight pages of data driven php
loveliness and a whopping MySQL database I'm faced with a bit of a dilemma.

Will search engines be able to crawl all the index.php?query paths so
people can find stuff? I'm currently at the top of the heap on Google as my
site has been around for years and is pretty niche and I don't want to lose
that advantage.

Which leads to the main part of the question; is there a 'site map'
generator which will vreate a single crawlable HTM page with all my
possible pages on iot which I can then link to from my home page which will
enable the search spiders to do their thing?

Or am I left with the unenviable task of having to put response/redirects
on all the old pages pointing to the equivalent dynamic pages?



Random Pixel Generator
Im trying to create a program that generates random pixels from a set picture.. i know how to write a random number generator its just figuring out how to take that one step further and getting it to grab pixels from a picture and show them one by one when somebody clicks generate button. there needs to be 1,000,000 pixels in total. Raar my head hurts trying to think of a way to do it!

Auto Generator Codes.
I know this is very easy.

what i want is a six codes generator.

Let say i have a button when i press this button it will generate six digit codes.
for example i have this code 543545.

now i wanted also when i use this code it will tell me it's the valid codes.

maybe you have the idea, just want to know the functions that i should use for this.

Secret Code Generator
The idea is that I can make a password and then encrypt it to make it safe when sending instant messages and emails to colleagues containing sensitive information.

The only way I could get this to work was by entering 1 letter per box. I want to be able to type a series of letter or words into one txt area and it be converted as usual.

Random Password Generator
how can I make a password generator using php and javacript so that whenever a button is clicked it generates a random password in a text box.

I've already done the password generator code. When I click on the button it generates a password but if I click it again it won't generate a different code.
So is there a way to have it generate a different password each time? Right now when I click on the button it will call the javascript function to change the text in the input box to  echo rand_pass(); like so

<input id="password" name="password" type="text" size="71" maxlength="128" style="margin-top:2px;" tabindex="26"/>
<input name="rand_pass" id="rand_pass" type="button" value="generate" onClick="generate( 'password', '<?php echo rand_pass(); ?>'  );" class="Buttons">

Sitemap Generator Script?
Does anyone know where I ca find a sitemap generator script?

Flat File Code Generator
I want to know how I can add breaks between table elements (html code) when it's generated from a flat file (input forms) ? Right now the code appears in one continous string, and I'd like it to be neat and tidy (breaking in the code after </td></tr> and </table>) Is this possible? Here's teh code, to show you what I mean :

http://stage.jpauldesign.com/mctl/h.../viewevents.php

Rapidshare Premium Link Generator :
I got a script from one of my friend.It is used for generating rapidshare premium links like : http://rapidfool.com/ But its not working !Code:

Six-random No Generator, But Not In Good Ordering
how to put a randomly generate in to an array, so that I can sort them with sort function?

result is:
B1 38 + 41 + 34 + 30 + 27 + 22
B2 34 + 22 + 10 + 35 + 18 + 11
B3 34 + 2 + 7 + 34 + 37 + 1
B4 30 + 34 + 7 + 2 + 27 + 25

//$holdno = array ($rno);
//sort ($holdno);
//echo sort($holdno);
//reset ($holdno);

I follow from php.net, they are wrong. I need something like:

$holdno(1)=no(random draw1)
$holdno(2)=no(random draw2)
$holdno[sixno] = $rno;
echo $holdno[sixno];

I tried this but I can't sort them.
....
....etc its very difficult, when a nos is drawn, it is not put back to pool, and continue to draw a nos. leave question 2 for the time being. PHP Code:

Php - Mysql Form Field Generator
does anyone know of a simple function/class that will take config
options: table name and the database connection stuff(or whatever)
It will then print out appropriate form fields to allow editing of a
row?

The reason being is that in the admin section of a website I am
building we are constantly adding columns to a table...It is used for
keeping config options of the site. We do not wanna update the form
each time we add a column.

Sequential Alphanumeric String Generator
I was wondering how I would generate a set of Alphanumeric strings with PHP. So the script would run and output something like:

a
b
c
d
..
x
y
z
aa
ab
ac
ad
...and so on.

Alpha would be good, although Alphanumeric would be much better. Also the option to define how many characters long the string can be would be a plus.

Permissions Problem With Sitemap Generator
I have bought a standalone xml sitemap generator online.I am new to webhosting and a newbie in all these stuff.I ahve followed all the instructions by the software provider, but still cant get my sitemap ready.
The error showing is

"config file is not writable: /home/mydomain/public_html/generator/config.inc.php
Datastorage folder is not writable: /home/mydomain/public_html/generator/data/"

however i have changes the permission of these files in my server to 0666 and 0777 as instructed. But when I try to save my configuration it shows the above mentioned error.

Temp Table - Random Number Generator
I am developing a data entry program where information is entered into a form, then submitted to a databse.

I need to be able to set up a temporary table which houses this data and then when all transactions are complete, the data in the temporary table is entered into my permanent table - then the temp table is deleted. (I won't get into the details as to why this has to be done this way)

Setting up the table is simple, however I ran into a bit of a wall when it comes to having several people entering data at the same time. If they were all to use the same temp table, then when one user finishes (and the table is auto-dropped) then other users data entry would be killed.

SOLUTION:
Use a random generator to name the temp tables, that way I can have several data entry users without running the risk of losing data when the temp tables are dropped.

PROBLEM
I don't know the best method to make a random number generator

Can anyone help, or suggest a simple, yet effective generator?


Copyright © 2005-08 www.BigResource.com, All rights reserved