Putty Processlist Command Sleep
I'm using php with mysql. I am connecting through putty and I run the command for processlist. Lately I am seeing many threads with the command "sleep" in them. My site and the database are running smoothly, but I am seeing up to 200-300 threads like this with the command "sleep". Can anyone tell me what may be causing this and how do I resolve it? Or is it normal to see this when your site grows to a certain size?
Code: ......
View Complete Forum Thread with Replies
Related Forum Messages:
SHOW PROCESSLIST "sleep"
when i view SHOW PROCESSLIST i always see command sleeps with some large times behind them.. can somone please tell me what that is and what that might be caused by? "Command" Sleep "time" 1585
View Replies !
Exporting Sql With Putty
want to export my database with putty. the only problem is I can't find my database file when I search my files. I've searched all my files and still nada. mysqldump -u db_username -p db_name > /path/to/backup.sql
View Replies !
Errors - Putty.exe (telent Connection To Mysql Database)
The following code produces an error when I try to run it under putty.exe (telent connection to mysql database). Can anyone identify the error in the code? The server is running PHP5. DELIMITER ;; /*!50003 DROP PROCEDURE IF EXISTS `aaa` */;; /*!50003 SET SESSION SQL_MODE="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER"*/;; /*!50003 CREATE PROCEDURE `aaa`() begin declare iTest int; set iTest = 5; end */;;
View Replies !
PHP Sleep()
I've been sitting for quite a while now, reading the sleep() manual and tried to turn the code upside down and inside out but nothing helps... I want the current page to wait a few seconds before it is directed to another ( after a successfull registration ). So i thought the best way to do that is to use sleep(). However, this does work to a certain point ... the current page waits for 5 seconds, but the text I want to show the user in the meantime doesn't show? Why? Without the sleep() and the header() it shows without any problem. Code:
View Replies !
Sleep()
I tried to make a script which would print a line of text at 1 line per second or whatever time i put. So i went ahead and tried this. PHP Code: echo "Passwords match."; sleep(1); echo "Passwords match."; sleep(1); echo "Passwords match."; sleep(1); echo "Passwords match."; This is a example and the text in echo has no meaning. However the sleep waits and waits for all the other sleeps to finish and then prints out all text at once.
View Replies !
PHP Messaging And Sleep
I would like to get my php script to send a message to a user for example to notify that a DB update or insert has been successful or not. After that the script will be redirected to the home page. how can this be done ? I have tried using sleep(5) to delay the script but that does not work the way that I want it to since it simply delays the execution of the ENTIRE script RATHER than a part of it !!
View Replies !
Sleep() In The Background
how much the sleep() which is set to no limit can consume the system resource. Could it cause to hang the server? I tried the following and couldnot see the server got busy. Although the browser seemed to be so, if I access to a different page, it responded very quick as usual. It's not a big deal, is it? sleep.php PHP Code: <?php set_time_limit(0); sleep(0); ?> fork_sleep.php PHP Code: <?php $str = "php -f sleep.php"; exec("$str > /dev/null &"); ?>
View Replies !
Fsocketopen & Sleep
I'm trying to setup a fsocketopen script to ping a site every 15 minutes or so and if the site is down, send an email. I'm thinking of using ignore_user_abort() to run the script in the background and sleep() for the time intervals. I'm not really sure how to script this out.
View Replies !
Sleep And Max_Execution_Time
I have the following code: $i=0; while($i++<15) { mail("rantsh@hotmail.com",date("d m Y H:i:s"),"This is email # $i "); echo "mandado $i <br>"; sleep(60); } Now, I know my server has a 30 second max_execution_time setting... nonetheless, this code runs successfully!!!. Now, this is actually better for me (for the application I need to run)... Yet I'm concerned of why it's being allowed to run for 15 minutes if max_execution_time is set to 30. Code:
View Replies !
Would I Use Sleep To Delay
I am making a site for a friend, but with his PHP it always renders too quick and I would like it to wait a bit for the rest of the page to load, otherwise its a bunch of annoying gaps and whacked alignment as the CSS and images load and it all just looks annoying as it loads. And it takes away from the order of of information outputted as it goes through the PHP when your focused on the tripped out layout.
View Replies !
Sleep Function
I'm playing about with delaying results of a PHP program. I want to print some results then wait for a few seconds and print some more. I have found the php sleep function however have a small problem. <?php echo ("The time in 3 seconds from page loading: "); sleep(3); echo date('h:i:s') . " "; ?> The above script is meant to print the top line, wait 3 seconds and print the bottom line. Infact, it starts, waits 3 seconds and prints all at once. Now from my understand from php.net it should not sleep untill it hits the sleep command in there.
View Replies !
Sleep For 10 Seconds Help
I am trying to run it will load an iframe for every entry found in my DB, I am trying to make it sleep for 10 seconds between each iframe with: PHP Code: sleep(10); PHP Code: $train = "<table width=800 bgcolor=F0F0F0 aling=center><tr><td colspan=4> $pages<br></td></tr>"; $i=0; while ($addall = mysql_fetch_assoc($res)) { Â Â Â Â if ($i/2 == ceil($i/2)) $train .= "<tr>"; Â Â Â Â $i++; $train .= "<td width=120 valign=top><BR><iframe src="potspace.php?u=$addall[intId]" width="400"></iframe>"; } $train .= "<tr><td colspan=4><br><br> $pages<br><br></td></tr></table>";
View Replies !
Tracert :: Passing Command To Command Prompt Via Exec
I want to execute a "tracert" command in the command prompt via php (using windows) I've managed to use passthru() to open the command prompt (but it doesn't allow me to use it) and when I close it, it outputs the command prompt output in the browser. I don't mind whether the result is passed back to the browser to stays in the command prompt window (but that would use exec() I would think). So how can I tell the command prompt that launches to execute the line tracert 192.190.201.273 So far my experimental code is: <?php passthru("c:windowssystem32cmd.exe"); ?> EDIT: my backslashes have been stripped from the path, but you know what I mean!
View Replies !
Session Timeout, Use Of Sleep Ect...
I have a custom script that uses sessions to track UID's. The only problem I have with the script is that the session times out in 1440 (min?) which I believe is 24 min. I was thinking that I could use php's sleep to hold off from doing a refresh until minute 20. Unfortunately, I have also read that using sleep can leave a server open to a DoS attack. I do not have access to the php.ini file to be able to change the timeout variable for the session. What is the best way to keep a session open without changing the .ini variable. Is sleep a good way do go about it, and if so, are there significant security risks in using sleep()?
View Replies !
Sleep() Affects The Variables?
could it be that the sleep() function affects my variables? When I set a very long delay time (1-3 hours) in my CronJob PHP4 script (of couse with a big set_time_limit) some of my variables go lost! But there's no problem with short times in the sleep-function (1-5 min). set_time_limit(86400); for($x=1;$x<5;$x++) { echo $x; //$x will be shown only one time sleep(7200);}
View Replies !
Need To Flush Before Sleep But I'm Blank.
I'm new to php and am converting a bunch of asp pages to php. Current problem : I am using a Submit button on a form to POST ( send the database variables ) to a php page that will send a personalised e-mail to each client. On the php page, I am looping through a database, compiling a message ( html format ), and mailing the message to my client. After the mail has been sent, I need to wait for 4 seconds before continuing with the next database record. I am using this code after the mail has been sent : echo "Mail Sent to : " . $row['CliName']; ob_flush(); flush(); sleep(4); Problem is, that nothing appears after I click on the Submit button on the first page's form ( the first page just remains on the screen ). Once the database has been looped, the entire (correct) output appears on my screen - but I need to see some sort of progress as it works it's way through the database.
View Replies !
Sleep(900) ? Delayed Query... ?
Trying to set a marker in a MySQL table on our Primary host (WAMP stack) indicating whether or not there is current User Activity -- ON THAT SERVER -- as a signal to remote Secondary -- tablet pc based servers to skip scheduled database synchronization with the Primary. Code:
View Replies !
Sleep() And Browser Load.
is there a way to get around the browser continually acting like they are loading when using sleep()? It says the page is still loading but it really isn't because we are causing a delay for some data on purpose with php. So it is for an intentional reason that we cause it. Many of us like using sleep(). Anyway to do it without the browsers showing the page is still loading? There must be a way, so many programmers for intense programming use sleep(), I can't imagine they have to deal with the browsers loading prompts whenever they do.
View Replies !
Staggering Execution With Sleep()
For my site, currently in development, I will be hosting some latest RSS picks from friend websites. To start with there will only be a couple, but eventually I hope to be sourcing from up to 50 partner blogs. Obviously, i dont want to make a request on every page load, so I would instead cache data from the past half hour/hour. I will be using CRON to schedule an update every so often, but having a single script making 50 requests one after the other then processing and storing the data may be taxing, especially if the outside server is slow. I thought about using sleep() to leave gaps between each request so that a sudden hogging of resources doesnt happen every hour. What are your views on this method? Is it feasable (and possibly even a good idea), or should I just get it all to execute in one go?
View Replies !
Resources Used When Using The Sleep() Function
I want to use the Sleep() function in a script that may run multiple times, but i dont want hte system to crash or be overloaded with scripts in memory. When the script enters a sleep mode, what happens to the script? is it resident in memory? if so could i experience the system bogging down if there were 100+ scripts resident in memory or are they just sitting there doing nothing until they run again?
View Replies !
SLEEP + Header Problem
I'm running a community website where I send out weekly newsletters to all of my clients. However, I'm sure my hosting provider wouldn't be so happy if I just FOR LOOP and send it all out at once. SO what I did was I just a SLEEP and a header mthod that triggers after every second, where the header sends out GET variables for the next iteration to fetch at which account I am currently at to send the next newsletter. Code:
View Replies !
Insert Sleep Every X Rows
i am trying to insert a sleep command in my loop every 100 rows, the below works for every 2 but if i try to sleep every 100 rows it will not work. if($i % 2) { sleep(5); } does not work [php] if($i % 100) { sleep(5); } [/php
View Replies !
Long Sleep() And Time-out's
The script I'm writing needs to wait a random amount of time (1-300s) between each iteration of a loop, eg. while(condition) { do something //wait between 1s and 5 minutes sleep(rand(1,300)); } Problem is, a browser times out if it doesn't get an answer within about 30 seconds. Is the idea of having a PHP script sleep for a longer amount of time incompatible with web applications? Any work-around?
View Replies !
Require_once And Fatal Errors... Automatic Sleep And Try Again Anyone?
I have a PHP page which loads OK 80% of the time. However the rest of the time I get the following error: Fatal error: Failed opening required 'DB.php' This really bugs me, especially since the only reason this is happeneing seems to be due to server load. I would like to add code so that instead of displaying the given error, the PHP code makes the HTTP response thread simply sleep a little bit (say 4 seconds), and then retry, and repeat until the file can be opened. It seems strange to me that server load would prevent the file from being opened. Anyhow, any ideas on how I can improve the situation?
View Replies !
Is There Something Like An OR Command?
I have a password section, where people submit their username and password and if valid, they get access. However, I would like only a few people from that database to get access, so I use a third colum called "user_id", and while the script checks for correct username/password is also checks:
View Replies !
Php Cli Command ...
Has anyone any idea why this doesn't work ? while read file ; do php -r 'urlencode($file);' ; done > file I've also tried cat file | php -r 'urlencode($0);' > file no luck there either ?
View Replies !
PHP-CLI And The Less Command
I have a CLI application that produces lots of output to the terminal, so I like to send the output along to the "less" command. This has always worked very nicely. Moving to the top or bottom of the output used to require just hitting the "home" or "end" key, and the up and down arrows as well as page up and page down worked nicely....
View Replies !
If And Where Command
I've got 2 tables... Lets say tableA and tableB I want to do this, but I dont know if it is possible: <?php if ($x_tableA_FIELD == "green") { ?> echo "$x_tableB_FIELD1" WHERE $x_tableB_FIELD2 == "green" <?php } ?> So I know the if part works... can this WHERE part work? And what would the syntax be?
View Replies !
AVG Command
I have done and redone this code many times. Can anyone help me figure it out? <?PHP $db = mysql_connect("host", $username, $password); mysql_select_db("database",$db); $sql = "SELECT AVG(votes) FROM requested"; $result = mysql_query($sql); $row = mysql_fetch_array ($result); echo $row; ?>
View Replies !
This Command
help me with this command below as you can see it has a M in it M= MEMBER and P= PENDING i need this command to includ the M and the P <? if($mtype=='M') { ?>
View Replies !
PHP On Exit Command ?
I have a main PHP script with multiple sub-scripts, that are called on certain events... Is it possible to create an "on exit" command, to tell me which sub-script (& line number) a PHP process ended on, if an "exit" command is encountered?
View Replies !
Command Execution
how do i run "perl /cgi-bin/cool.cgi" from within php file (4.1.0) on win 2000 with IIS. i know the paths to perl.exe and absolute path to cgi file also. i tried system("perl ......"); and exec(".......") but didn't work.
View Replies !
Running SCP Command
Is it possible for me to use PHP to run SCP? I know that I can use exec() or system() or shell_exec() to run a command, but when running SCP you have to run the command, and then enter a password, so is it possible to do that? If so, how would I do it?
View Replies !
Outputting The /usr/bin/top Command.
The code below will display the server uptime using the uptime command in linux. How would you go about displaying the /usr/bin/top command? i've noticed there are miscellaneous commands in linux relating to performance etc.. is there a way in php just to run a command like uptime and output it in its raw format? PHP Code:
View Replies !
Does The Phpinfo() Command Ever Lie?
I wanted to use the AddType directive in an .htaccess file. So I used phpinfo() to get the path info for PHP. I found this line: PATH /bin:/usr/bin So I tried this, but it did not work: AddType application/x-php .htm Action application/x-php /bin:/usr/bin/php AddType application/x-php .html Action application/x-php /bin:/usr/bin/php I also tried this: AddType application/x-php .htm Action application/x-php /usr/bin/php AddType application/x-php .html Action application/x-php /usr/bin/php I also tried this: AddType application/x-php .htm Action application/x-php /bin:/usr/bin/ AddType application/x-php .html Action application/x-php /bin:/usr/bin/ I tried a few other variations as well. Nothing. Then I went looking for a file called "php". I looked in /bin/ but it wasn't there. I looked in /usr/bin/, but it wasn't there. Does it go by another name? Why isn't it where PATH said it would be?
View Replies !
Links By Sql Command.
What I am trying to do is that I would like to know how to make links to take out my datas from my database. Let's say I will make 3 links. One is Name, Second is Country. Third is age. Whenever a user click one of them, it comes out my datas order by that(A-Z) like sql command---> order by name, ****ry, or age. I would like to make three links so that users can choose from these options.
View Replies !
Run From Command Line
I just installed the latest version of PHP as an Apache Module. I'm wondering, how can I now run PHP from the command line? I heard there was a way without having to reinstall PHP to do this.
View Replies !
Php Break Command
I have a while look inside of a for loop and when i use the break command it stops boths loops. I am wondering if there is a way to only have it stop the while look.
View Replies !
The Mail Command
I have apache/php/mysql installed on a win98 machine. When I try to execute the mail command in PHP3 it just doesn't work. any ideas?
View Replies !
Use The Ftp_put Command.
I was trying to use the ftp_put command. It worked for the files in the same directory as my php file, but if I try to fetch a file somewhere else on the server with the following syntax for the source file it doesn't work. "serverdirectory_pathfilename" also it didn't work with "//server/directory_path/filename" What is the correct way to access the file?
View Replies !
INSERT INTO Command
I have a table named Clients with the following fields: Name, Address, Phone. If I do this query: INSERT INTO Clients (Name, Address, Phone, Email) VALUES ('John Doe', Ƈ First St', 骃-5555', 'blah@blah.com') What does this do with the Email field and value since it was not in the table to begin with? Does it add that field automatically? If not, is there a way to add that field? I'm using MS Access with odbc.
View Replies !
COPY Command
Currently, I have a routine with the file command, & a foreach loop to save the file (append) to another file.. HOWEVER.. I've come accross a situation where one of my 'source' files is over 17 Megs, & my script times out... (im not echoing anything to the screen / cron jobs...) QUERY1 :- I cant see anywhere if the copy command can APPEND to an existing file ? (or does it just 'copy' - & replace whatevers there ?) Is there any other way - that I can 'append' files together - without timing out ? - PS - im re-running the entire process from the start - (just in case) - to see if the file is still 17 megs (its compiled from 900- other files - a summary file)
View Replies !
Better Exec() Command
I work in a network support office which uses a web form to receive network related problem reports from our end users. The web server is IIS 5.0 on win2k server, and we use PHP and MySQL to handle the form and tracking. I'd like this setup to launch an mp3 player on the web server when a problem report is sent in. I've tried exec("little mp3 player i wrote"), but there are two issues with it: 1) I think the mp3 player runs as the user who sends in the report. If the report is sent from the web server itself, everything works fine. Otherwise, the mp3 player runs in the background and can't be shut off. 2) The script waits for the mp3 player to be closed to finish. I'm guessing there's a different command that will solve problem 2, but I'm stumped on problem 1. It's more of an IIS/windows issue, probably,
View Replies !
|