Jump to content

williamZanelli

Members
  • Posts

    155
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

williamZanelli's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Hi guys, I have a scalability question - I have a for loop - after which I end with a String, 150 chars long - I write this to a log file. I;m thinking, if I rather than write to log file after each iteration, would it be better to append the Sting after each iteration, and write at the end of the loop? How long could my String be, I can potentially 1000 iterations * 150 chars - is it advisable to have such a long String in memory? Thanks for your advice
  2. Check your message for detailed response.
  3. Its not spam guys! Look at my track record of questions....
  4. Haha Thorpe, Thanks for the reply. Its not spam I can assure you of this. Priavte message me and I will provide my email, we can chat that way?
  5. Hi guys, I'm using cURL multi to send out post requests. My code is something like below - but with many more handles.. I'd like to send out 10,000+ requests [i have an array with 10k+ cURL handles,], whats the best and most efficient way of doing this? Thanks for your help & advice in advance. <?php //taken from http://php.net/manual/en/function.curl-multi-init.php // create both cURL resources $ch1 = curl_init(); $ch2 = curl_init(); // set URL and other appropriate options curl_setopt($ch1, CURLOPT_URL, "http://lxr.php.net/"); curl_setopt($ch1, CURLOPT_HEADER, 0); curl_setopt($ch2, CURLOPT_URL, "http://www.php.net/"); curl_setopt($ch2, CURLOPT_HEADER, 0); //create the multiple cURL handle $mh = curl_multi_init(); //add the two handles curl_multi_add_handle($mh,$ch1); curl_multi_add_handle($mh,$ch2); $active = null; //execute the handles do { $mrc = curl_multi_exec($mh, $active); } while ($mrc == CURLM_CALL_MULTI_PERFORM); while ($active && $mrc == CURLM_OK) { if (curl_multi_select($mh) != -1) { do { $mrc = curl_multi_exec($mh, $active); } while ($mrc == CURLM_CALL_MULTI_PERFORM); } } //close the handles curl_multi_remove_handle($mh, $ch1); curl_multi_remove_handle($mh, $ch2); curl_multi_close($mh); ?>
  6. Hi guys, I have a for loop, that queries my database, sometimes, close to 240 times, I want to minmise the DB access - what would be ideal is if I can query a result set, such as this.. $result = mysql_query($sql,$con); Is it possible for me to now run a query on $result. Such as select * from sometable where age >= '24' So, rather than access the DB over and over again, I just query the result set, which will be much faster. Any ideas on this one guys? Cheers Zain
  7. Well at the moment there's been no such issue with heavy load etc. However, given that I'm implementing code in this section, I'd much rather do the best way possibe - than to do a half ass job and then later realise its not as efficient/proper way of doing it.
  8. Hi guys, Periodically I have a need to execute some local PHP file to clean/update the DB - it takes some parameters. So I use a Cron file, that has WGET statments passing arguments in the URL. The benefit of this is to me is, I can manually via the browser execute the same file. I have been told that using PHP CLI is more efficient, Can anyone shed any light on this? Is it more efficient? Would i be able to manually excecute the PHP CLI file via a browser? Thanks for your thoughts in advance.
  9. Any body for this one??
  10. Hi guys, I need you advice, I normally get some good hints/pointers from here.. 1. Im looking for a good multi user CMS, that gives me (admin) full access on being to able to modify & disable, pages created by the users. 2. I want to have an independent signup - so any user can signup, get confirmation email and be able to create his or her page. 3. I want to have the ability to limit the number of pages a user can create, and choose the CMS (they see to update their page) 4. I want the CMS to be rich, in the sense that it allow users to totally customise their page/pages - background colors etc. completely. Any recommendations for open (or even propitary CMS's) would be nice. Thanks in advance.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.