Ottimizzare server per il web
-
Salve a tutti. Ho preso un server e per passarmi il tempo vorrei utilizzarlo solo ed esclusivamente per il web (apache, php, mysql, postfix, ftp,cron). Premesso che ho installato Ubuntu, mi sono cimentato per risparmiare risorse come RAM e CPU per tirare all'osso il mio server. Tanto per essere chiaro, ho cominciato a rimuire i servizi che non mi piacevano o cmq che a me personalmente non mi servivano.
al comando pstree comapre adesso questo:root@server:~# pstree init-+-apache2---26*[apache2] |-cron |-dovecot-+-dovecot-auth | |-3*[imap-login] | `-3*[pop3-login] |-events/0 |-7*[getty] |-khelper |-ksoftirqd/0 |-kthread-+-aio/0 | |-ata/0 | |-ata_aux | |-cqueue/0 | |-kblockd/0 | |-khubd | |-kjournald | |-kpsmoused | |-kseriod | |-kswapd0 | |-2*[pdflush] | |-xenbus | `-xenwatch |-master-+-pickup | |-qmgr | `-tlsmgr |-migration/0 |-mysqld_safe-+-logger | `-mysqld---16*[{mysqld}] |-sshd---sshd---bash---pstree |-udevd |-vsftpd `-watchdog/0 root@server:~#adesso vi chiedo..ma sti maledetti "getty" e khelper che diavolo sono??
quando faccio ps x mi compare questo:root@server:~# ps x PID TTY STAT TIME COMMAND 1 ? Ss 0:00 /sbin/init 2 ? S< 0:00 [migration/0] 3 ? SN 0:00 [ksoftirqd/0] 4 ? S< 0:00 [watchdog/0] 5 ? S< 0:00 [events/0] 6 ? S< 0:00 [khelper] 7 ? S< 0:00 [kthread] 9 ? S< 0:00 [xenwatch] 10 ? S< 0:00 [xenbus] 16 ? S< 0:00 [kblockd/0] 17 ? S< 0:00 [cqueue/0] 21 ? S< 0:00 [khubd] 23 ? S< 0:00 [kseriod] 82 ? S 0:00 [pdflush] 83 ? S< 0:00 [kswapd0] 84 ? S< 0:00 [aio/0] 214 ? S< 0:00 [kpsmoused] 243 ? S< 0:00 [ata/0] 244 ? S< 0:00 [ata_aux] 251 ? S< 0:00 [kjournald] 326 ? S<s 0:00 /sbin/udevd --daemon 992 tty4 Ss+ 0:00 /sbin/getty 38400 tty4 993 tty5 Ss+ 0:00 /sbin/getty 38400 tty5 998 tty2 Ss+ 0:00 /sbin/getty 38400 tty2 999 tty3 Ss+ 0:00 /sbin/getty 38400 tty3 1000 tty6 Ss+ 0:00 /sbin/getty 38400 tty6 1080 ? Ss 0:00 /usr/sbin/sshd 1128 ? S 0:00 /bin/sh /usr/bin/mysqld_safe 1182 ? S 0:00 logger -p daemon.err -t mysqld_safe -i -t mysqld 1817 ? Ss 0:00 /usr/lib/postfix/master 1833 ? S 0:00 /usr/sbin/vsftpd 1845 ? Ss 0:00 /usr/sbin/dovecot 1853 ? S 0:00 dovecot-auth 1901 ? Ss 0:00 /usr/sbin/cron 1920 ? Ss 0:01 /usr/sbin/apache2 -k start 1941 xvc0 Ss+ 0:00 /sbin/getty 38400 xvc0 1942 tty1 Ss+ 0:00 /sbin/getty 38400 tty1 8066 ? S 0:00 [pdflush] 14846 ? Ss 0:00 sshd: root@pts/0 14848 pts/0 Ss 0:00 -bash 15187 pts/0 R+ 0:00 ps x root@server:~#cosa posso rimuovere ancora?
-
khelper è fondamentale, serve per la gestione automatica dell'hardware mentre getty è il terminale virtuale e serve per effettuare il login fisico sul server
Nel tuo caso puoi rimuovere xen se non ti serve la virtualizzazione, dovecot che è un server di posta e vsftpd se non ti server il servizio ftp
-
-
-
Allora non togliere i due processi legati a Xen, perché sono indispensabili.
A occhio e croce dovresti aver installato Apache Worker. Forse risparmieresti di più se usassi Nginx o uns server leggero.
Se non usi InnoDB, disabilita il supporto in MySQL; dovresti guadagnare una 10 di megabyte di ram tranquillamente.
Ciao! Sembra che tu sia interessato a questa conversazione, ma non hai ancora un account.
Stanco di dover scorrere gli stessi post a ogni visita? Quando registri un account, tornerai sempre esattamente dove eri rimasto e potrai scegliere di essere avvisato delle nuove risposte (tramite email o notifica push). Potrai anche salvare segnalibri e votare i post per mostrare il tuo apprezzamento agli altri membri della comunità.
Con il tuo contributo, questo post potrebbe essere ancora migliore 💗
Registrati Accedi