#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2000
    Posts
    108
    Rep Power
    15
    Hello. I am posting this message to multiple groups...

    I have a very large MySQL table (over 1,000,000 rows, 7 columns) running with my site,
    and I need to write a script to bring the called data to the screen in HTML
    as quickly as possible.

    I have been testing with CGI, learning PHP, and now considering ASP. My current script
    (in PHP) takes 30 sec. to load, the CGI (not mod_perl) takes a couple seconds longer.
    I don't know what takes the largest proportion of the time, getting the data or running
    the script.

    Is there any advantages in speed between CGI, mod_perl, PHP, and ASP?
    I am attempting to mod_perl my CGI, but I am using a remote server... Thanks!

    yoshi
    datera@datera.com http://www.datera.com
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Newark NJ US
    Posts
    6
    Rep Power
    0
    I have been testing with CGI, learning PHP, and now considering ASP.

    Using ASP is a good decision.

    I don't know what takes the largest proportion of the time, getting the data or running the script.

    Lemme ask you something: how may records do you retrieve after 30 sec? what type of query are you writing?

    I haven't worked with MySQL-ASP combo. But, as far as ASP is concerned, use ADO and you should be fine.


    yoshi
    datera@datera.com http://www.datera.com [/B][/QUOTE]



    ------------------
    Harendra Vinayakbhai Bhagat
  4. #3
  5. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15


    <<
    I have a very large MySQL table (over 1,000,000 rows, 7 columns) running with my site,
    and I need to write a script to bring the called data to the screen in HTML
    as quickly as possible.
    >>


    Hi yoshi,
    I would suggest you to do this in Php.Cgi and asp may be slower than php.Also asp restricted only on NT platform.





    ------------------
    SR -
    webshiju.com

    "The fear of the LORD is the beginning of knowledge..."
  6. #4
  7. No Profile Picture
    Gödelian monster
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 1999
    Location
    Central Florida, USA
    Posts
    2,307
    Rep Power
    61
    I notice you mention ASP among your possible choices; does this mean you are running your MySQL database on Windows NT? If so, that might be your bottleneck. I don't know about the latest benchmarks, but in my experience, MySQL runs MUCH faster on a Unix platform than on a Windows one.

    My recommendation for a good platform to run MySQL and PHP is FreeBSD Unix.

    The next thing to consider is raw performance. In a simple query, searching seven columns, I doubt very much whether it will even matter which server-side programming method you use, as long as its scaleable (mod_perl with FastCGI, ASP, PHP). However, PHP now has an add-on called the Zend Optimizer that speeds it up even more. But the real question is what is your hardware?

    1. Do you have a dual processor system?
    2. Are you using SCSI drives or IDE? (IDE is a big performance hit for databases)
    3. Do you have a RAID array?

    Of course there are other performance factors also, such as indexing certain columns for faster searching, and other data layout optimization. And here is a link to the documentation on optimizing MySQL performance: http://www.mysql.com/documentation/m...rformance.html

    Hopefully somewhere in here will be the key to speed things up for you

  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Newark NJ US
    Posts
    6
    Rep Power
    0
    I agree with Shiju and rycamor. Because, if you want to use ASP, SQL server/Access or Oracle is the best. With SQL Server you can set connection pooling parameters to boost performance and Oracle has database cache to speed up the retrieval. ASP also works well with Ingress. All of these database products run on NT very well. But, for MySQL, I agree that Unix is the best. In fact, do it with Linux (I have a good experience with Caldera 2.3 and MySQL) and you will see the difference compared to NT.
    I assume that your project is suppoted with state-of-the art h/w.....but rycamor has made a good point there. it is really important...
    Finally, in my opinion you have two choices. Either go for SQL server/Oracle RDBMS if you are using NT/IIS/ASP...OR...go for unix based OS if you want to use MySQL.



    ------------------
    Harendra Vinayakbhai Bhagat
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Hubert, NC, USA
    Posts
    5
    Rep Power
    0
    Unless your host is really slow, PHP is not your bottleneck. I use an SQL backend on my web-sites to anthenticate users for every page access and the SQL lookup (against a small table) using PHP3 hardly takes a measurable amount of time.

    Optimize your database and your query. Make sure you have an index or indexes on the fields that are in your search criteria. If you are doing an index search over 1,000,000 rows using a Pentium 200 or better, you should be able to get your results in under 5 seconds. If not, you're running on a Microsoft platform or you don't have an index for your query.

Similar Threads

  1. Doing File uploads using a PHP as CGI
    By phoebebright in forum PHP Development
    Replies: 4
    Last Post: February 16th, 2004, 04:49 AM
  2. Replies: 0
    Last Post: February 12th, 2004, 11:56 AM
  3. Replies: 0
    Last Post: February 2nd, 2004, 05:44 PM
  4. Does using LIMIT speed up queries?
    By rlorenzo in forum MySQL Help
    Replies: 3
    Last Post: January 27th, 2004, 02:47 PM
  5. Translation: PHP to ASP
    By swedee in forum ASP Programming
    Replies: 0
    Last Post: January 19th, 2004, 11:11 AM

IMN logo majestic logo threadwatch logo seochat tools logo