Re: Excessive Server Load Problems
At 05:59 AM 25/02/2005, Atle Veka wrote: packs it in? Do you mean like you say that sendmail actually crashes when load goes above 5? I would guess sendmail is rather throttling itself and that you are seeing log messages about sendmail refusing connections. Is this a correct assumption? Sendmail can be configured to operate with higher loads. If sendmail actually dies, there's something really unusual going on. By packs it in I mean that its configured currently to cease working at load of 5 and above. It doesnt crash as such, but is set to shut down in the config of sendmail if load gets too high. To me it sounds like you are having problems with your database design and that you could benefit from some indexes perhaps. Do you have any indexes? If you list your table structure and queries that are bogging things down, the mysql list will be more than happy to help you. :) Its highly possible as this is the first database ive had to use with a large number of records. I shall look into indexing part of databasing now. Any suggested places to start that explains it helpfully ? Regards Chris Aitken The Web Hub Designer and Programmer Phone : 02 4648 0808 Mobile : 0411 132 075 - Turning your business into an e-business today. The Web Hub http://www.thewebhub.com.au/ [EMAIL PROTECTED] - Confidentiality Statement: This message is intended only for the use of the Addressee and may contain information that is PRIVILEDGED and CONFIDENTIAL. If you are not the intended recipient, dissemination of this communication is prohibited. If you have received this communication in error, please erase all copies of the message and its attachments and notify us immediately
Excessive Server Load Problems
Hi all, I have just created a databased website that is working with a fairly large number of records (well, 10 million records is the biggest database ive ever worked on so far) but also have a large number of searches of these records happening regularly. The problem ive come across, is my hosting providers box is setup so that if the server load gets to 5, sendmail packs it in. When someone does a search of the records, mysql jumps up to 100% cpu usage (which is fine) but the more searches that are being done (the website is getting more users daily) the longer the cpu is at 100% and the higher the load gets. I have been suggested to possibly have the hosting provider look at piping mysql through the nice application to keep its cpu usage under control. Is this a good method and will this make a difference, or is there a better way to tune mysql to keep load down? My understanding of nice is that it puts mysql's cpu usage priority at the lowest. But if nothing else on the box needs the CPU, it'll still run full and bring load over 5 making sendmail crash anyway. Any responses would be appreciated. Regards Chris Aitken The Web Hub Designer and Programmer Phone : 02 4648 0808 Mobile : 0411 132 075 - Turning your business into an e-business today. The Web Hub http://www.thewebhub.com.au/ [EMAIL PROTECTED] - Confidentiality Statement: This message is intended only for the use of the Addressee and may contain information that is PRIVILEDGED and CONFIDENTIAL. If you are not the intended recipient, dissemination of this communication is prohibited. If you have received this communication in error, please erase all copies of the message and its attachments and notify us immediately
mysqldump and a running mysql
Hi all, Just a real quick question about using mysqldump. Should I shutdown mysql before running mysqldump, or can I successfully do a mysqldump of my whole database while mysql is still running/processing records. I have a very big database, and want to go a daily dump backup, but I really dont want to have any downtime to process the backup. Any info would be appreciated. Chris -- Chris Aitken - Administration/Database Designer - IDEAL Internet email: [EMAIL PROTECTED] phone: +61 2 4628 fax: +61 2 4628 8890 __-__ # ln -s /dev/null /bin/laden If you don't like my typing, all flames to /bin/laden - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Query with avg on last 60 entries
I have come up with a bit of a problem which I cant seem to work out... I have a table that gets updated every minute with data. The table has 3 fields in it... id, date, number what im trying to do with a single query is, select the last 60 records, and output the average of the number field when I do the following query, it takes the avg of every record. select avg(number) from table order by date desc limit 60 Is this possible to do, or will I have to do a count loop within my program, then divide the count by 60 and do that output (which normally wouldnt be a problem, but im stuck in a perl script at the moment and I dont know enough about perl to do loops like this. Thanks Chris - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Ordering Semi-Numeric ???
Hi All, Ive been searching the archives and the documentation but dont really know the terminology im looking for, or even if its do-able or not so I figure I would just ask here instead.. I have a list of records in a table, and one of the fields is alpha numeric. They look like this... XY-1-BLAH XY-2-BLAH XY-3-BLAH XY-4-BLAH XY-5-BLAH XY-6-BLAH XY-7-BLAH XY-8-BLAH XY-9-BLAH XY-10-BLAH XY-11-BLAH XY-12-BLAH XY-13-BLAH Now whats happening, im sorting my query by this field and I want it to sort as it is above. however its putting it as the following order XY-1-BLAH XY-10-BLAH XY-11-BLAH XY-12-BLAH XY-13-BLAH XY-2-BLAH XY-3-BLAH Is there a way to sort this field (which is set to VARCHAR) by the first list, not the second list ? I know I can load all the entries up in an array and use a PHP type array sort function, but thats not really the outcome I need because ultimately I want to do a descending sort, and just grab the last record.. Am I making sense, cause ive managed to confuse myself a little here :) Cheers Chris -- Chris Aitken - Administration/Database Designer - IDEAL Internet email: [EMAIL PROTECTED] phone: +61 2 4628 fax: +61 2 4628 8890 __-__ # ln -s /dev/null /bin/laden If you don't like my typing, all flames to /bin/laden - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Weird Error Inserting
Unable to insert [ insert into match (league_id,round_id,team_id_1,team_id_2) VALUES ('1','3','2','3') ]: You have an error in your SQL syntax near 'match ](league_id,round_id,team_id_1,team_id_2) VALUES ('1','3','2','3')' at line 1. I have the above weird error when im trying to insert into a database. No matter what I try, I cannot seem to find the error. Any suggestions that im missing here. Its driving me nuts. the syntax seems to be okay as far as I can tell. Any suggestions here greatly appreciated. Chris - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
DBI on FreeBSD MySQL
I am writing a perl script on FreeBSD 4.3 running PHP and MySQL, however i get the following error message when I try and use DBI to connect to a MySQL database to pull some data. Can't locate DBI.pm in @INC (@INC contains: /usr/libdata/perl/5.00503/mach /usr/libdata/perl/5.0 0503 /usr/local/lib/perl5/site_perl/5.005/i386-freebsd /usr/local/lib/perl5/site_perl/5.005 .) a t /usr/sbin/scriptname line 9. Is there something I have not installed or do i have to modify a setup file? I have installed mod_perl and p5_apache_DBI and still getting this error. Any suggestions would be welcomed. Cheers Chris -- Chris Aitken - Administration/Database Designer - IDEAL Internet email: [EMAIL PROTECTED] phone: +61 2 4628 fax: +61 2 4628 8890 __-__ *** Big Brother *** It just shows that the dull will rule the world. And we will be watching it. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Expect Script accessing MySQL
Hi, Just a quick query. I haven't been able to locate any documentation on it, but has anyone ever used an expect script to connect to a MySQL database and pull out a bunch of data for use further in the expect script ? Any directions would be appreciated. Cheers Chris -- Chris Aitken - Administration/Database Designer - IDEAL Internet email: [EMAIL PROTECTED] phone: +61 2 4628 fax: +61 2 4628 8890 __-__ *** Big Brother *** It just shows that the dull will rule the world. And we will be watching it. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Expect Script accessing MySQL
At 11:36 PM 23/09/2001, Neil Zanella wrote: It is possible and not very hard at all. But why would you need expect? Why not just use a shell script? Because the task I need the script to do is best done using Expect (its interfacing with a serial port doing things with some data pulled out of a database). A psuedo flow of what it does is - * Fire off the expect script * The expect script grabs fields of data from mysql * The expect script uses that data and interfaces with a device hanging off a serial port. * The script ends with the result based on whether the interaction with the serial device succeeds or not. Thats why Im wanting to use expect... and thats why I am trying to find a way to get mysql data into an expect script. Chris -- Chris Aitken - Administration/Database Designer - IDEAL Internet email: [EMAIL PROTECTED] phone: +61 2 4628 fax: +61 2 4628 8890 __-__ *** Big Brother *** It just shows that the dull will rule the world. And we will be watching it. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Select Highest ID query
Hi all, Just quickly, Im managing to do this, but I can see that the method im using is not as efficient as it could be. What I want to do is this Make a query which will grab the record in a table that has the highest ID number. The ID field is auto incremental so what its saying is that the record with the highest ID field is the newest record. Any suggestions on how I can do this efficiently ? Thanks Chris -- Chris Aitken - Administration/Database Designer - IDEAL Internet email: [EMAIL PROTECTED] phone: +61 2 4628 fax: +61 2 4628 8890 __-__ *** Big Brother *** It just shows that the dull will rule the world. And we will be watching it. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Shutting down Mysql
Hi Guys, What im looking at doing is working out the best way to safely shut down mysql so I can do a full backup of the system, then restart it back. (im running on a FreeBSD box) I know I can kill the PID and other drastic measures but I dont want to do anything that might corrupt the data. Which is the best method for stopping mysql and then restarting it ? mysqladmin shutdown ? and whats the best way to start it back up again just running the .sh file(s) from /usr/local/etc/rc.d ? Thanks Chris -- Chris Aitken - Administration/Database Designer - IDEAL Internet email: [EMAIL PROTECTED] phone: +61 2 4628 fax: +61 2 4628 8890 __-__ *** Big Brother *** It just shows that the dull will rule the world. And we will be watching it. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Weird Ordering Queries
Ive come up with a curly problem and im wondering if anyone can shed some lights on it. I looked under the SELECT part of Mysql but it didnt seem to cover this and I didnt know how to phrase it. What I have is a displayed list on the site. This data that makes up the list comes from 2 tables. 'item' and 'location' are the 2 table names. For each item there is 1 entry in the item table. But under location there is several entries depending on where the part is. Its done this way to log a history of whether the item has been sent out, or received in. Each entry in the location table is date stamped and records the items location, and the item_id field. Currently I am doing my list like this. $item_q=mysql_query("select * from item order by item name"); while ($item=mysql_fetch_array($item_q)) { $location_q=mysql_query("select * from location where item_id=$item_q[item_id] order by date desc limit=1"); $location=mysql_fetch_array($location_q); echo"$itemlist[item_name] - $location[location] - $location[date]"; } The reason I do it this way is that I firstly need it to list all items, but then next step (and next SELECT) it grabs the most recent entry in location for that item. My problem is, I need to be able to combine the SELECT queries into 1, so that I can order by either Location, Date or Name Im not sure if this sort of thing is possible but it would make life so much easier if I could do it. Thanks Chris -- Chris Aitken - Webmaster/Database Designer - IDEAL Internet email: [EMAIL PROTECTED] phone: +61 2 4628 fax: +61 2 4628 8890 Unix -- because a computer's a terrible thing to waste! - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Making a table have no Duplicates
Hi Everyone. Just a quick question I worked out once before on my lonseome and the mysql manual, but it was longer ago than yesterday and it a blur how I did it. What I need to do is. I have a table, and in that table there are several fields which need to be unique. What do I need to do to make other fields within a table so that it rejects any duplicates. If for instance, I have a field called 'job_number' in a table called 'jobs' and it is 'varchar(50)' and I want to make it so that no duplicates are allowed, what command should I issue ? Thanks Chris - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php