
새 서버 Ubuntu 16에 문제가 있습니다. 서버와 프로세서의 모든 RAM을 100% 사용하도록 채우는 몇 시간 동안 apache2 프로세스를 계속 엽니다. 일부 악성 코드 때문인지 구성 오류 때문인지 확실하지 않습니다.
다음은 상위 프로세스입니다. 최고 프로세스
설정은 다음과 같습니다.apache2.conf
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
HostnameLookups Off
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<Directory /var/www/html/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
AccessFileName .htaccess
<FilesMatch "^\.ht">
Require all denied
</FilesMatch>
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 0
</IfModule>
<IfModule mpm_worker_module>
StartServers 2
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxClients 150
MaxRequestsPerChild 0
</IfModule>
<IfModule mpm_event_module>
StartServers 2
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxClients 150
MaxRequestsPerChild 0
</IfModule>
8GB RAM과 4개의 프로세서가 있는데 이 설정이 괜찮을까요?
답변1
우리에게 시스템에 관한 많은 구성 옵션과 임의의 데이터를 집어넣는 것은 전혀 유용하지 않습니다.
과학적인 방법을 적용해야 합니다.
- 모니터링 설치
- 데이터 수집
- 데이터를 사용하여 시스템 이해를 돕습니다.
- 위에서 배운 내용을 바탕으로 변경하세요.
- 변경 사항 모니터링
- 분석을 반복하고 필요에 따라 변경합니다.
- 문서 변경
그것은 로켓 공학이나 대체 사실이 아닙니다. 간단하게 적용되는 시스템 관리 원칙만 있으면 됩니다.
답변2
이것을 알아내세요. 일부 확장 프로그램이 계속 실행되고 몇 분 후에 CPU가 100% 켜져 있었기 때문입니다.
top
SSH를 사용하여 명령을 사용하여 이를 확인하는 가장 좋은 방법