Jump to content

abazoskib

Members
  • Posts

    548
  • Joined

  • Last visited

    Never

Posts posted by abazoskib

  1. im not very experienced with ajax, so im here to ask how i would be able to preload a form based on a dropdown list of Id numbers. so if i select id 3467 from my dropdown, the information gets loaded into the form for editing.  i think my more specific question is what should my php script return?

  2. i have a table that just recently got a surge of new data, and im pushing around 10million records. i feel like partitioning my data would definitely help with query speed, so i was wondering if anyone has personal experience with partitioning, and if there is an actual improvement.

  3. scandir() - to scan a folder for other folders/files

    is_dir() - to check if a folder is a directory, as opposed to being a file

    is_file() - check if it is a file

     

    you'll also need to be able to parse the folder names using explode() or regex/eregi

  4. use touch() to create a lock file -- a blank file, with any name you want.

     

    at the very beginning of the script check for the existence of the lock file(is_file()), if it exists exit(), else proceed

     

    then use unlink() to remove the lock file when the script is complete

  5. Yeah, php's cli is notoriously slow when compared to something like Python or Perl. I'm not sure APC would boost performance noticeably.
    APC can be used to cache data and objects in memory, but those data and objects are only shareable between different processes within the CGI environment. CLI scripts don't get to use APC for sharing, so there's a lot less benefit in using it. Memcache would be a better option than APC for sharing data/objects between CLI scripts.

     

    I've never found PHP particularly slow as a CLI scripting engine, at least not when the code is tuned to be efficient.

     

    code can ALWAYS be better. But thanks for the advice everyone.

  6. you could do this different ways. in mysql you can query the datetime field like so:

     

    SELECT TIME(timestamp) as time...

     

    which extracts the time part of that field for you to process, or you could parse your timestamp with PHP. I don't know much about regex or eregi, but I do know every date in your column will be of the form '2009-08-09 16:45:00' so you can explode that string at the space character. then do your calculations.

  7. you should optimize regardless of how many users you have. use indexes on the information you are most likely to query and is also not a primary key. dont use select * unless you need every single field in that table. query the exact fields you need. other than that, without looking at your relations i cant say much more. if you have admin access, you could also play around with your mysql settings. show variables; will give you around 264 settings to play with.

  8. I am sending data to a remote location and I want to optimize curl for speed. I do not need any return data.

     

    Here's what I am using so far:

     

    curl_setopt($ch, CURLOPT_URL, $url . $qry_str);
    curl_setopt ($ch, CURLOPT_NOBODY, 1);
    curl_setopt($ch, CURLOPT_TIMEOUT, 10);
    

     

    Are there any other setting I should look into for greatest speed?

×
×
  • 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.