I know about the general log but want to just log queries of a specific user. Our database does 400 queries/s on a slow day, so I think it would be a pain to grep though a huge log like that. And, im not sure if it would cause any preformance issues.
I'm currently hosting all of my stuff with my own Wild West Reselling Account, i.e., InnoDomains.com.
Problem is I'm running multiple Wordpress Installations and a few websites that have some pretty intense MySQL work going on in the background, and I use about 250GB per month in bandwidth.
My Account gets the 503 downtime errors because according to Customer Service I cannot run more than 50 MySQL queries in one second. Well, that's not much of a challenge because a lengthy wordpress page runs about 90 queries and loads in 2-3 seconds. Time this by three including the other websites and a couple of shopping stores, and I'm easily doing more than 100-150 queries a second more than several times a day, thereby seeing that nasty, irritating error.
My other option is to split up all the websites over basic $ 3.95 per month accounts. I don't want to switch to a dedicated server yet because I'm not really making a whole lot of money (about $ 30 per month). Another thing I could do is move my MySQL testing to a local machine, and that may actually reduce the load on the damn server.
Are there any hosts out there that will allow me to do more than 100 MySQL queries per second? If so, are there any that are any good?
This has happened twice now. I have my wait_timeout variable set to 60 seconds, but occasionally my database gets overloaded with "locked" queries. Here's an example of my processlist:
This continues on with locked queries all the way up to my limit of 450 connections, then the whole server goes down. Note the time spent processing these queries, 35483 seconds and counting! Surely the wait_timeout is supposed to prevent this from happening?!
Also, this appears to start with queries in the State "statistics". Then the State for the following queries becomes "locked". Does anyone know what these mean? Can I get them to timeout normally? Queries which never timeout are guaranteed to bring your server down eventually, surely this is not the desired behaviour.
I've been pondering something for a long time here, but never really knew the right question to ask, or how to word it... so I never even know what to search for. So I honestly have no idea what I'm asking or if this is even under the right topic. What I'm looking for is answers, links, tutorials, or just some words I can search for to help me do the following:
I have a MySQL database filled with accounts. People have to pay to get these accounts. All the accounts are set to expire on different days. I need to send an e-mail out to accounts, for example, to let them know they're expiring, say, a month before this will occur. Right now the only way I know to do this is to have MySQL queries on a PHP page that, every time the page is loaded, runs through all the accounts, checks their expirations, and sends emails to those that need it. I know there has to be a way to have this happen automatically without having to load a PHP page every day, for example.
What I did here was create /var/log/mysqld.slow.log for queries that are taking one second or longer. After around 36 hours, here is what I came up with. Since the file size of /var/log/mysqld.slow.log was 219KB, posting it in its entirety it not practical. Therefore, I used a program, the perl script known as mysql_slow_log_parser found on www.retards.org, to parse the mysqld.slow.log to make it easier to interpret and read. The result was that the original filesize of 219KB was converted to the smaller size of 14KB....
I have fairly a large web site that has a forum and a torrent tracker.
Currently MySQL server is handling about 150 queries an avarage per second. Here is the server spec:
Core2Duo 2.66Ghz 4Gb RAM 320GB SATA 7200RPM (Server provider does not have 1.5K RPM nor 1.0k RPM) 100Mbit Connection (servers on the same switch and the switch does not have 1Gbit port) MySQL Version: 5.0.51a
I had Master-Master Replication setup with forum running on one and the tracker running on the other. Although this has been working for about few days, we started seeing lags in the replication process. After a week, there is a major lag and the changes made on one of the servers takes about 5 hours to appear on the another. So, this doesn't work.
What would be the other ways of splitting MySQL queries concerning the same database?
While I was researching, I read about MySQL Cluster with database storage engine being NDB.
But, let's say that there is a power failure on both the nodes at the same time, then I would lose the whole database as the database is stored on the memory correct? I would not like to take that chance either, but if this is faster then replication method then maybe I will concider.
I thought about editing the forum coding to make all queries that concerns the tracker to go in to, say server B (with forum's primary MySQL server being Server A), and make the tracker use server B as MySQL backend, but it seemed like a heavy work so that will be the last choice.
I may have this wrong, but I think it's possible. I have a friend who wants to run a process on one of my servers, now I don't particularly 'care' about this server, it's just used for a couple of unimportant things so I'm okay with him running it, but I don't want the hassle of sorting out things if he decides to delete everything, so I'm hoping it's possible to limit his directory.
For example, I have the folder "people" in the top most directory, inside that I have "arthur", I want to limit the ssh user "arthur" to the folder "arthur", I don't want him to be able to cd ../../ and delete stuff, is this possible?
How can i restrict my user that always taking high CPU usages..i have linux server with shared hosting and most of the time i suffer that some user takes 10% of our server CPU so that i want to restrict those take high cpu usages..
configure Apache server to handle users requests using condition based on where he come from so i can redirect him . what i need if user came with from site start with xn--* redirect him to virtual host and if he came from any other link then go to another virtual host
I've got 25 domains on a Virtuozzo/Plesk8.6/CentOS5 VPS. Each domain has one up-to-date install of WordPress, most have very little traffic (average 200mb per month), maybe 2 domains get 5-7gb traffic per month.
I monitor port 80 connections and rarely see more than 10 at a time. That should in my opinion be no problem at all for a VPS with 768mb guaranteed ram and 2.4ghz cpu. I've got 30gb hard drive spare too.
But.... about 8 or 10 times a day it grinds to a complete halt: server load at 500-1000%, sites timing out, plesk takes 3mins to load, often I can't even connect with SSH, and the plesk web server, apache
80 seconds sounds like a huge amount of time for a MySQL insert to me! Does anyone know if this is likely to be the cause of my trouble? Some problem with Plesk and the database? Or could it be something else?
I have a moderately successful site, which makes enough money to cover my current hosting costs of 7 per month. I know, millionaire row it ain't, but it's popular. But my database is getting big and my current host wont allow the user of EXECUTE and SUPER privileges which I need to run triggers and stored procedures to keep the page load times sensible.
So, I need another UK host with:
- 2Gb of space (the site serves up big PDF documents)
- 70Gb of bandwidth (I said they were big)
- mysql privs available as above
Customer service with my current host, uk web solutions, is great (apart from refusal to countenance the privileges) so I need my new host to be as good. Budget? well, you can see what I'm paying now, and I have a psychological £10/month barrier which I don't want to cross.
I am using cPanel 11 (stable release) on a CentOS 5 server and would like to make it so that a certain database can only be connected to from the cPanel user that it is under (ie. user1_db can only be connected to from the user "user1" on the same server).
Does anyone know what could be the cause of this issue? I located a few others over at cpanel.net that have this problem, but no solution has been found.
[url]
I am running a VPS server with the following:
WHM 10.8.0 cPanel 10.9.1-S14304 RedHat 9 i686 - WHM X v3.1.0 phpMyAdmin - 2.9.0.2 MySQL client version: 4.1.10 mysql version: 5.0.27-standard
I have a database user that needs "Super Privileges" and so this was done. However, when Cpanel is updated the user permission is reset automatically from "ALL PRIVILEGES" to "USAGE".
Here's a look at the database permissions from phpMyAdmin.
Code: User Host Password Global privileges Grant hello localhost Yes ALL PRIVILEGES Yes hello_ % No ALL PRIVILEGES Yes hello_ localhost No ALL PRIVILEGES Yes
The user "hello" loses its "ALL PRIVILEGES" and switches over to "USAGE" if an update is triggered. Updates to cpanel, creating/removing a database/user, and updating the account password will cause the switch.
I am trying to start mysql but i am getting the following error
MySQL manager or server PID file could not be found! [FAILED] Starting MySQL................................... [FAILED]
I checked my hostname.err file in /var/lib/mysql and this is the error message it shows.
070130 17:59:41 mysqld started 070130 17:59:42 [ERROR] /usr/sbin/mysqld: Table './mysql/user' is marked as crashed and should be repaired 070130 17:59:42 [ERROR] /usr/sbin/mysqld: Table './mysql/user' is marked as crashed and should be repaired 070130 17:59:42 [ERROR] Fatal error: Can't open and lock privilege tables: Table './mysql/user' is marked as crashed and should be repaired 070130 17:59:42 mysqld ended
how I would repair that to get mysql to start again?
I want to use something like PHPBB forums and using one MySQL user and database. Just wondering, what are common user permissions I should set for the user? I want to try to minimize any permissions that can cause big risk to the server security.
Here is a full list of permissions I can grant to the user (via Webmin):
-Select table data -Insert table data -Update table data -Delete table data -Create tables -Drop tables -Grant privileges -Reference operations -Manage indexes -Alter tables -Create temp tables -Lock tables
I never did replication and do not know much about it so I figured I would ask here if anyone knows or has done it before like this.
I have a user who wants me to enable replication on my server for his user. I dont like the sounds of it on a shared environment but if there is no risk to other users and its not a big resource hog I will do it. Anyway, from what I gather I have to:
1. execute: GRANT REPLICATION SLAVE ON user_main.* TO 'repl'@'ip-here' IDENTIFIED BY '4T6WjUZa'; [url]
2. Stop mysql server and Add in my.cnf: [mysqld] log-bin=mysql-bin server-id=1 slave-compressed=1 binlog-do-db=user_main start server[url]
3. execute: SHOW MASTER STATUS; we need values of colomns File and Position from output of above command[url]
So my questions are:
Is there any security risk? Is there significant extra resource usage? Is this even done on shared environments?
I am using Cpanel. One Cpanel account is backup. I use it to backup my database.
Under mysql, I gave this account ( backup ) many priviledges. But when the backup script ran, error said that backup account can not 'lock table'.
I gave "lock table' priviledge again and run the script, it is ok. But after a while, when the script ran autmatically on daily basis, it lost the 'lock table' priviledge again.
I wonder if Cpanel is messing me up? What can I do about it? anyone knows?