I tried downloading and using the gcloud bash tool to manage my accounts, however everything I do with the tool is exceptionally slow. It will take MINUTES to reply to a command that is typed.
Is there perhaps a firewall I need to open up on my router or something else to get this to work fast like it's supposed to? For example, the "Installing..." lines in this video https://youtu.be/4y4-xn4Vi04?t=1m21s -- you'll notice they are all complete in the tutorial within a few seconds. This takes over 10 minutes to complete on my machine.
I'm on a newer Macbook Air, and all other internet/etc works really fast. I'm on a decent speed internet connection from AT&T Uverse (30mbps/3mbps). All other browsing is fast and just fine, the only thing in the world I have a problem with is this gcloud tool.
I just ran into a similar issue myself, though not as bad as minute long response times. What helped me was turning off the usage reporting.
Looking at some timings:
$ gcloud config set disable_usage_reporting False
$ time gcloud compute -h | tail -1
real 0m7.058s
user 0m0.464s
sys 0m0.088s
A whopping 7 secs to access the help!
Fortunately, this improves greatly after disabling reporting:
$ gcloud config set disable_usage_reporting True
$ time gcloud compute -h | tail -1
real 0m0.541s
user 0m0.459s
sys 0m0.080s
Much better!
I traced this back to packet filters. When I deleted this rule #5 in my AT&T Uverse modem/router (Motorola NVG589), everything works ok. This was a default setting in the modem which caused all sorts of issues.
Mark Shust's answer hinted to me that something might be going on with IPv6. Turning this support off in my router brought the gcloud times back to a couple of seconds from over 2 minutes for a gcloud compute machine-types list.
Note: I've also had to turn off IPv6 support in apt for a similar reason so this is likely a problem with my router or ISP, not the google cloud sdk.
Related
We use MySQL for our app. During dev and testing, we have to constantly reload the MySQL database, sometimes with very large amounts of data. In Linux, I would create an LVM snapshot to do quick rollbacks during testing to reduce turn-around time from 10-15 minutes to 30 seconds.
A number of our devs use Windows Subsystem for Linux (WSL) for their dev environment. It works great and allows them to mix the use of their Windows and Linux tools. Alas, unless things have changed recently, we don't have the full capability of LVM snapshots under WSL.
Are there any scripts we can use to create a MySQL snapshot and quickly restore to that rollback point? I'm aware we can manually review snapshots with mysqlbinlog, but that's rather tedious. I'd love a way to:
run a script start-point.sh
do our testing
profit
run a script rollback.sh
I'm very familiar with filesystem snapshots and so haven't done much with MySQL snapshots to date. The googling results are.. kind of a mess and I'm hoping there is an obvious "oh yeah, just use script ABC at this github link" if possible.
Thanks all.
P.S. If there is a better way of doing this in WSL I am all ears!
I have a small instance running in GCE, had some troubles with the MongoDb so after some tries decided to reset the instance. But... it didn't seem to come back online. So i stopped the instance and restarted it.
It is an Bitnami MEAN stack which starts apache and stuff at startup.
But... i can't reach the instance! No SCP, no SSH, no webservice running. When i try to connect via SSH (in GCE) it times out, cant make connection on port 22. In the information it says 'The instance is booting up and sshd is not running yet', which is possible of course.... But i cant reach the instance in no possible manner not even after an hour wait :) Not sure what's happening if i cant connect to it somehow :(
There is some activity in the console... some CPU usage, mostly 0%, some incomming traffic but no outgoing...
I hope someone can give me a hint here!
Update 1
After the helpfull tip form Serhii... if found this in the logs...
Booting from Hard Disk 0...
[ 0.872447] piix4_smbus 0000:00:01.3: SMBus base address uninitialized - upgrade BIOS or use force_addr=0xaddr
/dev/sda1 contains a file system with errors, check forced.
/dev/sda1: Inodes that were part of a corrupted orphan linked list found.
/dev/sda1: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
(i.e., without -a or -p options)
fsck exited with status code 4
The root filesystem on /dev/sda1 requires a manual fsck
Update 2...
So, i need to fsck the drive...
Created a snapshot, made a new disk from that snapshot, added the new disk as an extra disk to another instance. Now that instance wont boot with the same problem... removing the extra disk fixed it again. So adding the disk makes it crash even though it isn't the boot-disk?
First, have a look at the Compute Engine -> VM instances -> NAME_OF_YOUR_VM -> Logs -> Serial port 1 (console) and try to find errors and warnings that could be connected to lack of free space or SSH. It'll be helpful if you updated your post by providing this information. In case if your instance run out of free space follow this instructions.
You can try to connect to your VM via Serial console by following this guide, but keep in mind that:
The interactive serial console does not support IP-based access
restrictions such as IP whitelists. If you enable the interactive
serial console on an instance, clients can attempt to connect to that
instance from any IP address.
more details you can find in the documentation.
Have a look at the Troubleshooting SSH guide and Known issues for SSH in browser. In addition, Google provides a troubleshooting script for Compute Engine to identify issues with SSH login/accessibility of your Linux based instance.
If you still have a problem try to use your disk on a new instance.
EDIT It looks like your test VM is trying to boot from the disk that you created from the snapshot. Try to follow this guide.
If you still have a problem, you can try to recreate the boot disk from a snapshot to resize it.
I have a ubuntu server and i want to monitor it and start mysql service if it goes down, what can i do programatically to implement this.
I see this solution and set it via cron to execute every minute.
#!/bin/bash
if [[ ! "$(/usr/sbin/service mysql status)" =~ "start/running" ]]
then
/usr/sbin/service mysql start
fi
but would setting a cron to execute every minute load my server.
Any help in this direction will be appreciated. Thanks.
For the most part, running a short script like that every minute won't stress your server. So programmatically, assuming you tested it and all, I don't see much wrong with your approach.
I'd be more concerned as to why your service randomly shuts down though, have you looked for clues in logs? Depending on the severity of the cause, perhaps implementing a monitoring tool like nagios or icinga might be useful.
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.
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.