리눅스 메모리 사용률, 방화벽 질문

익명 사용자의 이미지

centos 를 쓰고 있는 서버에 메모리 사용률이 너무 높습니다.

1. free -g 해서 보면 used/tatal 이 90% 가 넘어 90%넘게 사용 중인 것으로 나옵니다.
buffers와 cached 를 빼서 (used-buffers-cached)/total 로 비율을 구하면 좀 떨어지긴 하나,
그래도 다른 서버에 비해 메모리 사용률이 현저히 높은 상태입니다.

어떤 프로세스가 메모리를 많이 사용하나 싶어 top 으로 확인해보아도 메모리를 90%넘게 사용할 만한
프로세스는 확인되지 않는데요, 리눅스에서 캐시 영역으로 잡아두는 부분 때문에 그런 것 같습니다.
(그걸 계산해도 여전히 차이가 나긴 합니다.. ㅠ)

리눅스에서 캐시 영역으로 꽤 많은 메모리 자원을 잡고 있는데 문제가 없을까요?(다른 서버도 동일하게
centos 사용 중 인데 왜 이 서버만 그럴까요..)

참고했던 링크입니다.
https://zetawiki.com/wiki/%EB%A6%AC%EB%88%85%EC%8A%A4_%EB%AA%85%EB%AA%A9%EB%A9%94%EB%AA%A8%EB%A6%AC%EC%82%AC%EC%9A%A9%EB%A5%A0,_%EC%8B%A4%EC%A7%88%EB%A9%94%EB%AA%A8%EB%A6%AC%EC%82%AC%EC%9A%A9%EB%A5%A0

2. firewall 방화벽에서 특정 포트 허용 시
firewall-cmd --permanent --add-port=25,80,110,143/tcp 처럼 한 줄로는 설정이 안되어

firewall-cmd --permanent --add-port=25/tcp
firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --permanent --add-port=110/tcp
firewall-cmd --permanent --add-port=143/tcp

이런 식으로 포트 별로 각각 입력하여 설정 하였는데, 한 줄로 한번에 여러 포트를 허용 하는 정책을 넣을 순 없을까요?

ifree의 이미지

캐시 영역이 많다고 해도 별 문제는 없습니다.
다른 프로세스에서 메모리를 요구하는 경우에 캐시는 즉시 반환되기 때문에 오히려 성능 향상에 도움이 되지 않을까요?

playka의 이미지

저도 그렇게 생각했지만 다른 서버들도 캐시 영역을 많이 잡고 있긴 하나, 이 서버 정도는 아니여서요..
추가 솔루션을 도입하는 것도 있고 해서, 이래저래 결국 메모리 증설을 하기로 했네요 ㅎㅎ

chanik의 이미지

https://www.cyberithub.com/firewalld-examples-open-port/

방화벽 복수개의 포트 허용하려면 shell의 브레이스 확장을 이용해서 아래와 같이 하면,

firewall-cmd --permanent --add-port={25,80,110,143}/tcp 

아래와 같이 확장되어 실행됩니다.

firewall-cmd --permanent --add-port=25/tcp --add-port=80/tcp --add-port=110/tcp --add-port=143/tcp

iptables 명령을 직접 쓸 때는 아래와 같이 복수개 포트 지정도 가능합니다. 이 경우 한 명령에 줄 수 있는 포트 최대갯수는 15개입니다. (https://askubuntu.com/questions/840490/iptables-match-multiport-need-clarification-dport-or-dports-sport-or-sport
)

iptables ... -m multiport -dports 25,80,110,143 ...
playka의 이미지

이걸 찾고 있었는데.. iptables 사용 시 까지 알려주셔서 정말 감사드립니다!

bushi의 이미지

df -h 로 tmpfs 마운트 된 곳들을 확인해보세요.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.