Is there some way to prevent a byobu terminal from timing out? - byobu

The ssh session in my byobu terminal is timing out from inactivity if left open for long. Is there some way to keep the keep the terminal alive because it prevents me from seeing the output to the screen in long running sessions. I am using byobu on Ubuntu 14.04.

It sounds like it's actually your SSH session timing out, as Byobu sessions so not time out.
Check the ssh(1) manage, and perhaps look at the options: ServerAliveInterval, ServerAliveCountMax, and ConnectTimeout options which you can set in your ~/.ssh/config.

Related

How to detect what is running on MySQL every hour?

Munin showing huge spike on MySQL queries every hour but I am unable to detect what is causing this. I am running version 5.6.30.
Tried to enable slow running queries but can't find it there.
Also logged all queries and tried to see what is running on that particular time. I cannot find it.
Checked cronjobs but there wasn't anything related
Disabled almost everything on LFD & CSF
The event scheduler status is set to OFF
Is there any other way to find what is running every hour?
Munin graph showing sql queries:
You can use a shell script and put the instruccion "processlist" and send the output to a log file.
Put the delay in seconds that you want for run again the instucction.
while [true];
mysql -h localhost -u root -ppasswd < process
delay xtime
done
And the file processlist you put the instrucction "show full processlist"
I hope this help you
Regards
Some crawlers were mining data from my website. I wasn't able to detect because requests sent from a million different IPs.
Added captcha to website as human control and spikes gone.

phpMyAdmin run very slowly and use too many CPU

I am using phpMyAdmin, it run very slowly. For everything I do, I see loading dialogs in about 5-10 seconds. When I use phpMyAdmin, Apache use around 60% CPU.
When phpMyAdmin do something, Apache for one second changes ports to 55617 and 55618.
In my apps communication with database is not slow as in phpMyAdmin and Apache use CPU under 10% of.
Why?
EDIT: SOLVED. I remembered when it started and i think it started when i enable XDebug. I set xdebug.profiler_enable = 0 and it works good.
Enabling XDebug in XAMPP slows down phpmyadmin

Other than network what can affect ping times?

I have a database server running on a AIX box. When pinging the server I see increased ping times at certain times. I am directly connected to the box and usually see 0ms or 1ms ping times. Sometimes I see ping times of 10ms to 12ms. I am wondering a bit how ping is actually implemented in the TCP stack. If the number of other open connections could affect its responsiveness. Anyone have ideas?
We have found that processor preemption is causing problems with ping latency. (Where PHYP steals the whole processor over to itself or to another LPAR.) If you can, try switching to dedicated processors. There are more subtle ways to get good results but I'm the network guy, not the CPU perf guy so I'm sorta out of my league.
In 6.1 TL06 SP05 until about 6.1 TL07 SP05, processor folding was also broken. The work around was to set vpm_cpu_folding (I think thats the name of it) to 4. The same is true for 7.1 releases that came out at the same time.

Is expect code going to through error if i reboot remote machine?

i am not sure what will happen so i am asking this question and also because i didn't tested this.i have a function send command which sends commands to remote machine and it works fine for normal commands but what if it sends command for reboot like below.
sendcommand reload
expect -re "$prompt"
send -- "exit"
expect eof
i mean after reload how would the rest of the script going to excecute or it will thorugh some error or it will work fine? please guide.
It depends on exactly how you ask for the reboot to be done. Rebooting may be done by asking the system to restart, and the time to process that might allow you to exit. Or it might not; there's a race condition. You certainly need to drop the network connection though; when the OS comes back, it won't recognize it and you'll get a forced connection reset (if not before).
Or you could ask it to reboot a couple of seconds in the future (I forget the exact syntax for this) to give yourself time to disconnect. Some individual research and experimentation is likely to be needed; VMs are good for this as they restart much more rapidly…

mysql server has gone away - how do I debug the reason?

I'm experiencing "mysql server has gone away" in my import script written in php
This http://dev.mysql.com/doc/refman/5.0/en/gone-away.html page has a list of possible reasons. But, how do I debug this, to know which of the reasons?
If some time out fired, I want to know which that his happened, which timeout etc. relevant details. If the query was broken, I want to know that this is the reason.
So, do I have a way to receive the details additionally to just the very global piece of information that the server "has gone away"?
Is there a way to log this stuff: timeouts for example?
I wouldn't think that there's a MySQL magic bullet to find out. It sounds like you need to use operating system and/or network diagnostic tools. Maybe within PHP you can do some things like try pinging the server, checking if the MySQL daemon is running, etc. You might also want to check into using a tool such as Wireshark or tcpdump to see if you're seeing anything funky on the network, such as reset packets or other dropped connection indicators.
If the MySQL server is remote, try doing a constant ping to it and see if you're seeing dropped or delayed packets. Make sure you check with large packets; I've seen systems on which a ping works fine, but routers screw up larger packet sizes due to MTU mismatches and such. On Windows, it is:
ping -t -l 1500 mysqlhost
On most Linux and Unix systems, it is:
ping -s 1500 mysqlhost