-
Notifications
You must be signed in to change notification settings - Fork 0
Devops: Linux tips
Deleting or Vacuuming Journals To delete archived journal entries manually, you can use either the –vacuum-size or the –vacuum-time option. In the example below, we are deleting any archived journal files, so the journal size comes back to 200MB.
$ journalctl --vacuum-size=200MERROR mmap() failed: [12] Cannot allocate memory
mmap() failed: [12] Cannot allocate memory PHP Fatal error: Out of memory (allocated 621813760) (tried to allocate 33554440 bytes) in /usr/share/php/Composer/DependencyResolver/RuleSet.php on line 84
SOLUTION To enable the swap you can use for example:
sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
sudo /sbin/mkswap /var/swap.1
sudo /sbin/swapon /var/swap.1CHANGE WELCOME MESSAGE SERVER
sudo nano /etc/motd Check Files size
du -hsx -- * | sort -rh | head -10
```
OWNER
Check swapfile ```
ls -aJust follow these steps:
Make all swap off
sudo swapoff -a Resize the swapfile
sudo dd if=/dev/zero of=/swapfile bs=1M count=1024 Make swapfile usable
sudo mkswap /swapfile Make swapon again
sudo swapon /swapfile Clear systemd journals older than X days The first one is time-based, clearing everything older than say 10 days.
$ journalctl --vacuum-time=10d opcache.enable=1
opcache.memory_consumption=128
opcache.max_accelerated_files=3000Mysql import with error When exporting with workbench - click Advaced Options - set-gtid-keys = OFF
Now the exported file will not have any garbage