Instance seems to be running low on memory

66 views
Skip to first unread message

James Lampert

unread,
Oct 20, 2017, 1:44:06 PM10/20/17
to gce-discussion
It appears that we somewhat underestimated the memory requirements of our GCE instance. Probably because we hadn't initially planned on putting quite so much stuff on it. How do we increase the memory on it?

Dinesh (Google Platform Support)

unread,
Oct 20, 2017, 4:37:55 PM10/20/17
to gce-discussion

Hello James,


Can you please confirm which type of memory you want to increase to your VM?


If you want to add disk drive to your VM, you can follow Adding or Resizing Persistent Disks


If you want to increase RAM, you can change machine type of VM instance. Changing the Machine Type of a Stopped Instance and understand different machine type in GCE.  There are standard type machine and high memory machine. Please note that changing machine type does have billing implications.


It is advisable to make regular backups of your persistent disk data using snapshots. Consider taking a snapshot of your persistent disk data before you change the machine type.


James Lampert

unread,
Oct 23, 2017, 6:19:01 PM10/23/17
to gce-discussion
On Friday, October 20, 2017 at 1:37:55 PM UTC-7, Dinesh (Google Platform Support) wrote:

Can you please confirm which type of memory you want to increase to your VM?


If you want to add disk drive to your VM, you can follow Adding or Resizing Persistent Disks


If you want to increase RAM, you can change machine type of VM instance.


RAM, of course. If I'd meant disk, I'd have said disk.

At any rate, the current instance is a "g1-small" launched from a Bitnami Trac server image. Since its inception, we've added MySQL and Tomcat to it, and as a result, "free" at the command line returns

             total       used       free     shared    buffers     cached

Mem:       1745320    1672836      72484      52188      85840     216796

-/+ buffers/cache:    1370200     375120

Swap:            0          0          0


Does the fact that it was launched from a Bitnami image impact the process of switching machine types?


We currently back up Trac, SVN, and MySQL periodically to a local USB hard drive in our own server cage.

James Lampert

unread,
Oct 23, 2017, 6:23:30 PM10/23/17
to gce-discussion
Oh, and it's running Debian Jessie.

Dinesh (Google Platform Support)

unread,
Oct 24, 2017, 1:14:56 PM10/24/17
to gce-discussion

All GCE-managed instances can have their machine type changed in the same manner, so this should not impact the process.


Be sure to read about the best practices for changing your machine type prior to doing it.

James Lampert

unread,
Oct 24, 2017, 2:03:41 PM10/24/17
to gce-discussion
On Tuesday, October 24, 2017 at 10:14:56 AM UTC-7, Dinesh (Google Platform Support) wrote:

All GCE-managed instances can have their machine type changed in the same manner, so this should not impact the process.


Be sure to read about the best practices for changing your machine type prior to doing it.

Thanks. I've been reading about snapshots. The only persistent disk involved here is the one boot/root drive:

~$ sudo df

Filesystem     1K-blocks    Used Available Use% Mounted on

/dev/sda1       20509288 8328664  11220824  43% /

udev               10240       0     10240   0% /dev

tmpfs             349064   35168    313896  11% /run

tmpfs             872660       0    872660   0% /dev/shm

tmpfs               5120       0      5120   0% /run/lock

tmpfs             872660       0    872660   0% /sys/fs/cgroup



 The how-to page on snapshots talks about freezing the file system before taking the snapshot:
sudo fsfreeze -f example-disk_location

How (assuming it's even possible to do so) do I freeze the boot/root drive?
"sudo fsfreeze -f /"?
"sudo fsfreeze /dev/sda1"?

--
JHHL 

James Lampert

unread,
Oct 24, 2017, 5:25:57 PM10/24/17
to gce-discussion
Mission accomplished.

Stopped the instance, pulled a snapshot of the hard drive (while at lunch, I realized that stopping the instance would flush everything, so I checked to see whether I COULD snapshot the disk with the instance stopped), and then bumped it up to an n1-standard-1.

I also noticed the "customize" link. It looks like I could, at least in theory, add a certain amount of memory through that, without having to go to a bigger box.

Dinesh (Google Platform Support)

unread,
Oct 25, 2017, 10:06:00 AM10/25/17
to gce-discussion
Yes, you can choose to use a custom machine type and add additional RAM to the machine through "customize" link on the console. Moreover, the system provides an option to increase RAM further with respect to the numbers of CPU if you select “Extended Memory”.

On Way

unread,
Oct 26, 2017, 9:01:05 AM10/26/17
to gce-discussion
Hello,

Google Cloud platform always persuades free users to resize machine memory.
Reply all
Reply to author
Forward
0 new messages