Max Number Of Processes
how can i determine what the maximum number of processes i should open
with popen (or proc_open) is? i assume it'd depend on the hardware of
the computer in question, but if that were teh case, then is there a
way to get info. about it, and some general method to determine a good
number of processes to open from that info?
View Complete Forum Thread with Replies
Related Forum Messages:
Limiting The Number Of Spawned MySQL Child Processes
Need to know if there is any way to limit the number of spawned MySQL child processes in linux ? I have done my research at http://www.mysql.com and have not been able to find my answer. Have also looked at the source code (what i can understand of it). Using MySQL v.4.0.25-max. Using an older system and the 14 childern are just bogging the system down. I am the only one with access to the server so 14 childern is overkill.
View Replies !
PHP Processes
I have a cronjob triggering a php script that takes several minutes to accomplish. I need to prevent multiple triggering by the cronjob mulfunctioning. So I would like a clean way to know how many instances of a certain php are currently working on the server. is there a server variable for that? if not, how do I know (via php) how many concurrent accesses are there to a certain php page? for example in mysql (the "SHOW PROCESSLIST" command), but I need a similar function for the php page iself.
View Replies !
Background Processes
I'd like to know how to send an external process to the background, so that I can run multiple instances of the same process at one time. Any tips, links.. etc?
View Replies !
Listing Processes In PHP
Using PHP, is it possible to return and display a list of currently running processes on the client's machine? In fact, is it possible to run a system command on a client's machine?
View Replies !
Automated Processes
Customers post 'projects' to my site. These 'projects' are closed after 10 days. I could run a script on the default.php page that detects this, but it seems a waste of resources to run it everytime someone visits the site. Is there a way around this, for example the first visitor to the site in any, say, 3 hour period, runs the script & switches the most recently outdated projects from open to closed?
View Replies !
Stranded PHP Processes And ProcessExplorer
Does anyone know what it means if I see PHP processes in the process tree at the base level, instead of under the IIS worker process? I do nothing but web serving off of the box. These processes that are not under the IIS worker process seem to be stranded/hung. They are never cleaned up by any garbage collection and I have to kill them manually. They also always have a fairly low memory usage, potentially indicating that they fail before loading completely. Could it be that the execution of the process fails early enough that ProcessExplorer doesn't see them as being executed by IIS?
View Replies !
Handling Long Processes
I am building web app, that will run a long processs (image processing) that can porbably take 15-30 minutes to complete) in respond to a user request (the user clicks a "process" button on a php web form). The ideal situation that I see is once the user's request was recevied, a reply that says "you request is being processed. we will send you email once finished", will be sent to the user, while the other process will take place. When it's finished, a callback function will be called that sends email to the user notifying him the process outcome. What are the options to implement that? multithreading?
View Replies !
Shared Memory Between 2 Processes?
I have two running php processes (they have infinite loops) and I need them to pass some data to eachother. Writing and reading shared memory in one process works just fine but when I try to save var in process1 and read in process2 I get error: "Variable key 555 doesn't exist". What I'm doing wrong? //PROCESS 1 (saving var) $key = 'My Key' $value = 'My Value' $app = 'lovelyapp' $key = $key . 'a' $segment_key = abs(crc32($app . $key)); $segment_size = 1024; $segment_perms = 0600; $shm_id = shm_attach($segment_key, $segment_size, $segment_perms); shm_put_var($shm_id, 555, $value); shm_detach($shm_id); // PROCESS 2 (reading var) $key = 'My Key' $app = 'lovelyapp' $key = $key . 'a' $segment_key = abs(crc32($app . $key)); $segment_size = 1024; $segment_perms = 0600; $shm_id = shm_attach($segment_key, $segment_size, $segment_perms); $value = shm_get_var($shm_id, 555); shm_detach($shm_id);
View Replies !
Insert Processes Before Form Is Submitted
I am trying to stop using Macromedia as my crutch and you guys have been a big help. I need some assistance with submitting a form. I have a form on my page and need to do an insert. I have the action posting it back to the same page I am on versus sending it to an insert page. The problem I am having is it trys to do the insert as soon as I pull up the page instead of waiting till the form is submitted. I believe I need to do something with isset, but can't really find a tutorial that goes over it really well. Code:
View Replies !
Forking Multiple Processes At A Time
i have a php script that needs to execute an external php script (call this script 2) when the user clicks a link, however I don't want the user to have to wait until script 2 finishes executing before he sees the output of script one... i know I can use the exec() command to do this, and use the & to run the command in the background.... but say i want to run 100 instances of script 2 when the user clicks the link (with different arguments)... i dont want to have all 100 processes running at the same time... what I would like to do is run 10 or so at once, and once those 10 are completed, run another 10...
View Replies !
Large Data Transfer Between 2 Processes
fist the context: I have a web server which query a mySql database. but as the number of parralel queries increase, the server slows down too much. I got 2 ideas, one of which is to run N deamons which effectively execute requests. the PHP uses message queuing(1) to queue queries request to the daemons. but the answer may be quite large, larger than messages the message queueing service can handle. I thought to open back a communication link between the current daemon and the waiting PHP to tranfer/process the result, using the message queueing service to send back info regarding the opened link. I thought to open a pipe between the current daemon and the PHP. is this possible? and if so, how? if not, is an IP link to localhost be as fast as a pipe?
View Replies !
Keeping Users Informed In Lengthy PHP Processes
Often PHP processes take a long time, such as wildcard searching a PostgreSQL database, or generating thumbnails. The PHP host page does not display until the script is complete, so you can not effectively use code such as echo "Converting file ".$Infile; exec(convert $Infile $O8utfile); for realtime feedback to the user. How have others implemented a "progress meter" in PHP processes , one thought I had was to use Javascript redirection to call a PHP page with differing parameters each time .
View Replies !
Sending Signals To Processes As A Different User Than Owner Using Php
i know, it seems more to be a problem according to unix but i got it while developing software with php: i have 2 different users on a hp-ux machine that execute php scripts. they are both in the same group. these php scripts start background processes, i can communicate with using signals (sending with posix_kill, starting background processes via pcntl_fork). so i got severel background processes owned by my 2 users. the problem is i want to send signals as one of my 2 users to all my php background processes no matter who of my 2 users is the owner. is it possible other than using external tools like sudo? i'm using: PHP 4.3.4 (cgi) (built: Aug 18 2004 15:37:46) Copyright (c) 1997-2003 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies compiled with: ../configure' '--prefix=/usr/local/php-cgi-saprfc' '--enable-calendar' '--enable-filepro' '--with-gd' '--with-jpeg-dir=/usr/local' '--with-zlib-dir=/usr/local' '--without-mysql' '--enable-sysvsem' '--enable-sysvshm' '--with-pgsql=/usr/local/pgsql' '--enable-trans-sid' '--with-cpdflib=/usr/local' '--enable-sockets' '--with-ncurses=/usr/local' '--disable-shared' '--with-tsrm-pthreads' '--with-saprfc=/usr/local/rfcsdk' '--enable-pcntl
View Replies !
Max_execution_time Ignored, Multiple Apache Processes Spawned
I have an app that is going berzerk on its own; without any code or environmental changes of any kind, for some bizarre reason it will randomly just hang, spawn multiple Apache processes and completely ignore max_execution_time, literally running infinitely. Using PHP 5.2.0, Apache 1.3 and Win XP Is this normal "bizarre" behavior that can occur within this setup; if so, what workarounds have you found to combat this, other than the obvious (try to debug and fix code)?
View Replies !
Checkboxes - Loop That Takes The Values And Processes And Writes The Changes To The Database.
I generate a form page from my MySQL database. let's say the table structure is: Table A > ID, title, active the number of rows generated by the query is dynamic. If a field's value is 1, then the form output appears as <input type=checkbox name=$ID checked> $title and if not <input type=checkbox name=$ID> $title At the bottom of the form there is a submit button. The visitor can check/uncheck rows and then submit the form. I need to write a loop (possibly foreach) that takes the values and processes them and writes the changes to the database.
View Replies !
Build A Page That Takes Form Data, Processes It In A Second Page
I'm trying to build a page that takes form data, processes it in a second page, then sends the user to a third,depending on data processing. On the second page, I am trying to get the page to have some sort of "Loading" message while the backend processes the data, but I can't seem to get anything to work. Does anyone know how I can get that Loading message to display?
View Replies !
Replace Hex Number Or Decimal Number In A String ?
String may contain alphanumeric values. What is the bestway to replace a hex number such as 0x122aaa and decimal number such as 5678 with a string "blah" Example: I want to replace below-- wr_thru1 data or mask mismatch!! for addr=0x00000b73a0540 & mdfid:11 with wr_thru1 data or mask mismatch!! for addr=hexVal & mdfid:decVal
View Replies !
Get The Field_id Where The Number 22 Exists In The Number Column
I need to do the following. Say I have a table like this, I would like to get the field_id where the number 22 exists in the number column. Code: -> +------------+------------------+ | field_id | numbers | +------------+------------------+ | 1 | 12, 19, 22 | | 2 | 9, 22, 14 | | 3 | 11,6,88 | | 4 | 1, 16, 22 | +------------+------------------+ <- ...
View Replies !
Order Query By Number Only Reads First Number .
I have a result page which has price lists, but for some reason the code cannot distinguish between 25,000 and 5,000. Another words in a DESC price result, i get: 80,000 78,000 72,000 6,000 52,000 42,000 It reads the first number, and if first number is the same it reads second, but how do i get it to Order by the entire Number?
View Replies !
Order Number Or Tracking Number
I need to create some kind of random number within a persons session that can be inserted into a customer id column for their orders, customer, and credit card tables. Unless their is a better way to link a customers information together between a few tables besides using auto increment. Things could get screwed up for me if I use auto increment, especially if someone submits their information but does not actually place an order. My question is " How can I create a random order number that can be used within a persons session and will stay the same throughout the whole program for that one person? "
View Replies !
Difference Between The Current Number And The Next Number
I need a little help writing a math formula in php. I want to find the difference between the current number and the next number that will divide evenly into X. For example: I have 7 rows of data in my table. If I divide 7 by 3, I have a remainder. The next number that can be divided by 3 with no remainder is 9. I'd like to return 2.
View Replies !
Number Format - Convert Number.
This should be SSOOO simple, but I'm having a brain cramp this morning or something. How can I convert: 0.475 To 48% I'm sure there are some simple PHP commands that I already should know by now to convert that number.
View Replies !
Database Stores Default Number Everytime, But I Havent Set A Default Number??
Im having some problems with my database. Everytime i store a number which is longer than 10 numbers the script or database puts this number into the database: 2147483647. Its does this everytime no mather how i write the numbers and nomather how long the number is, it just needs to be over 10. I have set any default value in the database and to be sure i havent i tried deleting the table, but same thing happends again???
View Replies !
Number For Each Value
What I am doing is getting values from a database and what I need to do is print out each of them and print a number for each one, like this.
View Replies !
Odd Even Number
if I have a for loop : for ($i=0; $i<count($replyDetails); $i++){ ... bgcolor = 123 (OR 456)... ... } and will show bgcolor = 123 if $i is an even number or $i=0 and will show bgcolor = 456 if $i is an odd number
View Replies !
Number St Nd Rd Th
How can I have a number variable and see whether it needs a st, nd, rd, or th at the end?like 1st, 2nd, 3rd, 4th... I originally thought I could select the last number but for example if it equaled 11, 12 or 13 the idea wouldn't work as they take th.
View Replies !
Number To Day
I was wondering if anyone as figured out a way to go from a day of the week in numerical format to the actual name. Such as: 0 - Sunday, 1 - Monday, ect... I can go from Name to number, but not back again. I have tried: PHP Code:
View Replies !
IP Number
I need to figure out the ip number of the pc inside PHP. This is the number available when you do ipconfig, and not the 127.0.0.1. So the slow way I have figured out is to do a system call to doc, using `ipconfig`, and then regex the result and figure out the ip. Is there a fater/more efficient way to do this? Articles individually checked for conformance to usenet Visit Topic URL to contact author (reg. req'd).
View Replies !
Number Between
How do I find out if a number is between or equal to. Lets say x=333. How do I tell if it's between or eqqual to 300-500.
View Replies !
Number<10
if ($weapondmg<=10) { return $victimnewhealth=$killquery+1000; }elseif ($weapondmg<=20) { return $victimnewhealth=$killquery*0.20; }elseif ($weapondmg<=30) { return $victimnewhealth=$killquery*0.50; }elseif ($weapondmg<=40) { return $victimnewhealth=$killquery*0.50; }elseif ($weapondmg>=40) { return $victimnewhealth=$killquery*0.50; } i understand the above code will co through untill one of them validates as true BTW $weapondmg=somwhere between 40 AND 55 with mt_rand So therefore the last elseif should be the only one to be true however it executes the FIRST one.
View Replies !
Max Number
Players need Turns to kill monsters, attack other players, buy stuff, etc. I made a script which ads 15 turns to all players and used a cronjob to run it every 15 minutes. Now is it possible to make a max amount of turns? For example a 2000. So when a player has 1999 turns and the script runs, he gets 2000 and he doesn't get any more turns until his number is below 2000 again. Code:
View Replies !
Get 5% Out Of Any Given Number
Does anyone know the formula in php to get 5% from any given number? For example: like on my site it shows that lets say I made $300.00 today and I get to keep 5% of that so now I want it to show 5% of 300 which is 60. so I would get to keep $60.00 dollars. How or what is the code to get 5% of any number in php?
View Replies !
Whole Number
I have a basic if statement here: if($addarmies < 0){ // Info } Its looking to to ensure the addarmies is a positive value. But its allowing decimals to occur, adn I need it only allow whole numbers.
View Replies !
Number Of Records
I want to find out how many records, but I am using LIMIT in mySQL so if set the limit to 20 and I have 56 records then it will display 20 instead of 56. I have been using: mysql_num_rows What should I be using?
View Replies !
Help With Getting A Number Of Posts
Hi, I've been trying to make a message board of sorts, and I'm having trouble getting the number of posts in each forum to show correctly. The two tables in mysql im trying to use in order to do this are a table called info, and a table called forumlist. Forumlist has two columns, one with forum_id, and one with forumname. Right now it has three entries, Test Thread, Game Thread, and Discussion Thread, with forum_ids of 1, 2, and 3 respecitively. In the table info, there is a bunch of columns pertaining to the author, the description, but those don't really matter, the one column that does in info is the column forum_id which is an integer I am using to keep track of which thread is in which forum. Right now there is only one entry in the info table, and that has a forum_id of 1. I have been trying to get it to show that there is one total post in the Test Thread, and 0 in the two others, but for some reason it keeps saying there is one in the Game Thread, and 0 in the others. I tried changing the forum_id to 2 in the info table, but then it said that I had one post in the Discussion Thread and 0 in the others. It seems to be jumping ahead by one for some reason. I could use some help, here is my code:
View Replies !
Number Sorting
I have a database from which I extract the top ten rows, dependent on a certain value. However, when two entrys have the same value they get the same placement in the "top ten" thingie. I know I can sort them first by position, then by for example name, but that doesn't do it for me. (1) Printing the values gets me; 1. Malmö 2. Limhamn 3. Jönköping 4. Stockholm 4. Västerås 5. Sjöbo 5. Södertälje 6. Väsby 6. Ystad 6. Örebro (2) The problem is that it SHOULD say; 1. Malmö 2. Limhamn 3. Jönköping 4. Stockholm 4. Västerås 6. Sjöbo 6. Södertälje 8. Väsby 8. Ystad 8. Örebro You see the difference? In (1) "5. Sjöbo" should actually be "6. Sjöbo", since it's the sixth value, cause there are two cities sharing the number 4 spot. The code I'm using; Code: while($row = mysql_fetch_object($result)) { if ($prev_value == $row->name) $i=$i-1; echo $i.". ".$row->city_name." "; $prev_value = $row->name; $i++; }
View Replies !
Add Number In List
I am outputing a list of 10 values. 10, 20, 30, 40, etc I can add 15 to one of the values then reorder the values from smallest to highest but i want to update every single value and assign it values increamenting by 10 so after the update the second number of 20 and add 15 I get 10, 30, 35, 40 now i want to re output the values above as 10, 20, 30, 40
View Replies !
Random Number In PHP
<?php srand( microtime() * 1000000); $num = rand(1,100); echo("Random Number:".$num."<br/>"); ?> Every time, it generates number 1... Why?
View Replies !
|