the problem is on a hetzner Q7 Server with as little as 512MB RAM, MySQL keeps crashin.

what can you do?

repartition? -> DANGEROUS and almost impossible without powering down the system.

ADD SWAP AS FILE!

# check out if and how much swap is configured on your system
cat /proc/swaps;
Filename Type Size Used Priority
# -> seems pretty empty

# let's add a swap file
dd if=/dev/zero of=/swapfile bs=1024 count=524288; # generate 512MB Swap File /swapfile
# 1048576 for 1GB
# 2097152 for 2GB

chown root:root /swapfile; # secure permissions on swap file
chmod 0600 /swapfile;
mkswap /swapfile; # make the system use the swap file
swapon /swapfile; # enable it

vim /etc/fstab; # make swapfile permanent

# At the bottom of the file, you need to add a line that will tell the operating system to automatically use the file you created:

/swapfile none swap sw 0 0

# now let's rerun our first check-swap-space command
swapon
NAME TYPE SIZE USED PRIO
/swapfile file 512M 0B -1

cat /proc/swaps;
Filename Type Size Used Priority
/swapfile file 524284 0 -1 > /etc/sysctl.conf

# configures how much the system will choose to cache inode and dentry information over other data

cat /proc/sys/vm/vfs_cache_pressure;
100

# Basically, this is access data about the filesystem. This is generally very costly to look up and very frequently requested, so it's an excellent thing for your system to cache

# As it is currently configured, our system removes inode information from the cache too quickly. We can set this to a more conservative setting like 50 by typing:

echo "vm.vfs_cache_pressure = 50" >> /etc/sysctl.conf;
admin