[ask] kenapa server nyaris kehabisan memory ???

Diskusi tentang Ubuntu Server baik webserver, database server, samba server dan service lainnya serta jaringan menggunakan Sistem Operasi Ubuntu.
User avatar
upik
Posts: 99
Joined: 05 Jun 2010, 14:52

[ask] kenapa server nyaris kehabisan memory ???

Postby upik » 06 Nov 2010, 09:19

Dear Ubuntu Forum

saya mohon ijin bertanya, saat ini menggunakan ubuntu server 10.10 khusus untuk squid, squidguard dan webmin. kejadian yang saya alami, jiak cek dengan "free" sering kali memory fisik nyaris habis terpakai dan mulai menggunakan swap-nya. Sehingga akses menjadi makin lemot. Padahal proxy server tersebut baru digunakan 2 hari? apakah ada saran bagaimana mengatasi ini ?

Tks
User avatar
blackshirt
Posts: 2336
Joined: 02 Jan 2010, 17:00
Location: Solo dan Kebumen
Contact:

Re: [ask] kenapa server nyaris kehabisan memory ???

Postby blackshirt » 06 Nov 2010, 09:50

menganalisis bottle neck macam itu perlu tahu konfigurasi system yang digunakan,beban server,kondisi server..dll..mungkin juga proses yg jalan bnyak
User avatar
thrvers
Posts: 4458
Joined: 01 Jan 2010, 13:28
Location: Jombang, Indonesia
Contact:

Re: [ask] kenapa server nyaris kehabisan memory ???

Postby thrvers » 06 Nov 2010, 09:56

'
mungkin squid.conf nya :D ada yg 'bermasalah'

= :confused: =
User avatar
danz0
Posts: 140
Joined: 19 Jan 2010, 12:37
Location: Suroboyo

Re: [ask] kenapa server nyaris kehabisan memory ???

Postby danz0 » 13 Nov 2010, 11:53

sebaiknya memang harus lebih detail bro..
mulai spek hardware yg digunakan
squid.conf nya
trus proses yg jalan..
User avatar
upik
Posts: 99
Joined: 05 Jun 2010, 14:52

Re: [ask] kenapa server nyaris kehabisan memory ???

Postby upik » 20 Nov 2010, 11:01

Berikut ini Spek Hardware saya:
IBM Server dengan Memory 4GB, HDD 250GB,

Squid.conf dibawah ini
Tampilkan

#################################################################
# Port
#################################################################
http_port 3128 transparent
icp_port 0
prefer_direct off

#################################################################
# Cache & Object
#################################################################
cache_mem 6 MB
cache_swap_low 98
cache_swap_high 99
max_filedesc 8192
maximum_object_size 128 MB
minimum_object_size 0 KB
maximum_object_size_in_memory 32 KB
ipcache_size 4096
ipcache_low 98
ipcache_high 99
fqdncache_size 4096
cache_replacement_policy heap LFUDA
memory_replacement_policy heap GDSF

#################################################################
# cache_dir
#################################################################
cache_dir ufs /cache1 20000 46 256
cache_dir ufs /cache2 20000 46 256
cache_dir ufs /cache3 20000 46 256
cache_dir ufs /cache4 20000 46 256
cache_dir ufs /cache5 20000 46 256

cache_access_log /var/log/squid/access.log
cache_log /dev/null
cache_store_log /dev/null
pid_filename /var/run/squid.pid
cache_swap_log /var/log/squid/swap.state
dns_nameservers 127.0.0.1 202.148.1.195 202.148.1.196 8.8.8.8
emulate_httpd_log off
hosts_file /etc/hosts
half_closed_clients off
negative_ttl 1 minutes

#################################################################
# Rules: Safe Port
#################################################################
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 563 873 # https snews rsync
acl Safe_ports port 80 # http
acl Safe_ports port 20 21 # ftp
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 631 # cups
acl Safe_ports port 10000 # webmin
acl Safe_ports port 901 # SWAT
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl Safe_ports port 873 # rsync
acl Safe_ports port 110 # POP3
acl Safe_ports port 25 # SMTP
acl Safe_ports port 2095 2096 # webmail from cpanel
acl Safe_ports port 2082 2083 # cpanel
acl purge method PURGE
acl CONNECT method CONNECT
#acl malware url_regex -i "/etc/squid/malware_block.txt"
acl ie_browser browser ^Mozilla/4\.0 .compatible; MSIE # STOP IE browser & ultrasurf
acl bad_browser browser ^Gator # Gator is also crap!
acl ie_exceptions dstdomain .nyata.co.id

# bloking UltraSurf/Skype
acl numeric_IPs url_regex ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+


http_access deny CONNECT numeric_IPs all
http_access deny bad_browser
http_access allow ie_exceptions
http_access deny ie_browser
#http_access deny malware
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports !SSL_ports
http_access deny CONNECT !SSL_ports !Safe_ports

#################################################################
# Refresh Pattern
#################################################################

refresh_pattern ^ftp: 1440 50% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern (Release|Package(.gz)*)$ 0 80% 2880
refresh_pattern -i .(jpg|png|jpeg|bmp|gif)$ 10240 90% 43200 override-expire
refresh_pattern -i .(deb|rpm|tgz|bz2|tar|gz)$ 10240 100% 43200 override-expire
refresh_pattern -i .(class|css|js|gif|jpg)$ 10080 90% 43200 override-expire
refresh_pattern -i .(jpe|jpeg|png|bmp|tif)$ 10080 90% 43200 override-expire
refresh_pattern -i .(tiff|qt)$ 10080 90% 43200 override-expire
refresh_pattern -i .(gz|arj|lha|lzh)$ 10080 90% 43200 override-expire
refresh_pattern -i .(rar|tgz|tar|bin)$ 10080 90% 43200 override-expire
refresh_pattern -i .(hqx|pdf|rtf|doc|swf)$ 10080 90% 43200 override-expire
refresh_pattern -i .(inc|cab|ad|txt|dll)$ 10080 90% 43200 override-expire
refresh_pattern -i .(asp|acgi|pl|shtml|php3|php)$ 2 20% 4320 reload-into-ims
#refresh_pattern . 0 80% 4320


#################################################################
# HAVP + Clamav
#################################################################
cache_peer 127.0.0.1 parent 3128 0 no-query no-digest no-netdb-exchange default


#################################################################
# HIERARCHY (BYPASS CGI)
#################################################################
#hierarchy_stoplist cgi-bin ? .js .jsp
#acl QUERY urlpath_regex cgi-bin \? .js .jsp
#no_cache deny QUERY


#################################################################
# SNMP
#################################################################
snmp_port 3401
acl snmpsquid snmp_community public
snmp_access allow snmpsquid localhost
snmp_access deny all


#################################################################
# ALLOWED ACCESS
#################################################################
# HTTP OPTIONS
# ###############################################################

acl QUERY urlpath_regex cgi-bin \?
acl apache rep_header Server ^Apache
#acl Sos-Net url_regex -i "/etc/squid/sosial.txt"
acl Waktu-kerja time MTWHFA 07:30-11:30
acl Web-sehat dstdom_regex -i vivanews liputan6 okenews metro tv trans hotmail google gmail yahoo pajak depkeu
acl Waktu-kerja time MTWHFA 11:35-22:00

acl VVIP src 172.16.10.7 172.16.10.18 172.16.10.42 172.16.10.102
acl All-Website dst 0.0.0.0/0.0.0.0
acl VIP src 172.16.10.0/25
acl To-Lokal-Server dst 202.127.107.226-202.127.107.230 202.51.103.114-202.51.103.118 192.167.1.1-192.167.1.2 202.148.22.210-202.148.22.216
acl Lokal-LAN src 172.16.10.0/25

acl Webmin port 10000
acl File-Multimedia url_regex -i \.3gp \.ac3 \.aif \.aifc \.aiff \.asf \.au \.avi \.dat \.div \.divx \.dts \.dvr-ms \.flv \.m1v \.m2v \.mid \.midi \.mkv \.mp2 \.mp2v \.mp3 \.mp4 \.mpa \.mpe \.mpeg \.mpg \.mpv2 \.qt \.ram \.raw \.rm \.rmi \.rmvb \.snd \.vob \.vqf \.vro \.wav \.wma \.wmv \.rar
acl File-Pics url_regex -i \.srf \.tga \.tif \.tiff \.tif \.ttf \.hdf \.wbmp \.wmf \.x3f \.xbm \.xpm \.cr2 \.crw \.dcr \.djvu \.emf \.eps \.fpx \.icl \.icn \.iff \.jp2 \.jpc \.mrw \.nef \.orf \.pbm \.pcd \.pcx \.pef \.pgm \.pic \.pict \.plp \.ppm \.psd \.psp \.raf \.ras \.raw \.rs \.sgi
#acl File-Execute url_regex -i \.exe \.msi \.rpm \.bin
acl Waktu-Jumat time F 08:00-16:00
## acl Lokal-DHCP src 192.168.1.0-192.168.1.254
## acl Web-Refresh dstdom_regex -i facebook.com detik.com
## acl Streaming url_regex youtube
acl Other dstdom_regex -i livescore
acl src_ip_me src 192.168.100.122
acl Porn-url url_regex -i "/etc/squid/porn.txt"


## cache deny QUERY Web-Refresh
## log_access deny src_ip_me
http_access deny !Lokal-LAN

http_access allow VVIP
http_access deny Porn-url
#http_access deny Sos-Net
http_access deny !Safe_ports
#http_access deny File-Execute
http_access deny File-Multimedia
http_access deny Other
http_access allow VIP
http_access allow Web-sehat
http_access deny !Waktu-kerja
## http_access deny Streaming
http_access allow !Waktu-kerja
## http_access deny Lokal-DHCP
http_access allow Webmin
http_access allow To-Lokal-Server
http_access deny All-Website
http_access deny all
broken_vary_encoding allow apache

# ie_refresh off
# vary_ignore_expire off
#extension_methods OPTIONS PROPFIND REPORT MERGE MKACTIVITY CHECKOUT

###############################################################################
# Extra Additional
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.0.0.0/8 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network

follow_x_forwarded_for allow localnet
follow_x_forwarded_for allow localhost

tcp_outgoing_tos 0x30 localnet
zph_mode tos
zph_local 0x30
zph_parent 0
zph_option 136



################################################################
# ADVANCED NETWORKING OPTIONS
# -----------------------------------------------------------------------------
header_access Accept-Encoding deny all
client_persistent_connections off
server_persistent_connections on
half_closed_clients off
strip_query_terms off
quick_abort_min 0 KB
quick_abort_max 0 KB
quick_abort_pct 100
vary_ignore_expire on
reload_into_ims on
pipeline_prefetch on
range_offset_limit 512 KB
read_timeout 30 minutes
client_lifetime 6 hours
negative_ttl 30 seconds
positive_dns_ttl 6 hours
negative_dns_ttl 60 seconds
pconn_timeout 15 seconds
request_timeout 1 minute
store_avg_object_size 13 KB
log_icp_queries off
ipcache_size 16384
ipcache_low 98
ipcache_high 99
log_fqdn off
fqdncache_size 16384
memory_pools off
forwarded_for on
max_filedescriptors 8192

#################################################################
# Cache CGI & Administrative
#################################################################
cache_mgr bangnapi
visible_hostname bangnapi
cache_effective_user proxy
cache_effective_group proxy
coredump_dir /var/spool/squid
shutdown_lifetime 10 seconds
logfile_rotate 1


redirect_program /usr/local/bin/squidGuard -c /usr/local/squidGuard/squidGuard.conf
redirect_children 10
useragent_log /var/log/squid/usragent.log


Proses yang berjalan apache2, lightsquid, squidguard dan webmin
kondisi saat pesan ini diketik;

#free
total used free shared buffers cached
Mem: 4047216 3860644 186572 0 319040 2735860
-/+ buffers/cache: 805744 3241472
Swap: 3905532 160 3905372

Proses menjadi makin lambat ketika swap sudah mulai terpakai ??

mohon bantuan analisanya..

TKS
User avatar
upik
Posts: 99
Joined: 05 Jun 2010, 14:52

Re: [ask] kenapa server nyaris kehabisan memory ???

Postby upik » 27 Nov 2010, 10:06

Pak Bu..ada yang bisa bantu kah ???
detail yang diminta sudah saya sertakan diatas ..
User avatar
Rh354
Posts: 718
Joined: 14 Mar 2010, 19:56
Location: between the truth and the lies
Contact:

Re: [ask] kenapa server nyaris kehabisan memory ???

Postby Rh354 » 27 Nov 2010, 18:18

upik wrote:Berikut ini Spek Hardware saya:
IBM Server dengan Memory 4GB, HDD 250GB,

Squid.conf dibawah ini

#################################################################
# Port
#################################################################
http_port 3128 transparent
icp_port 0
prefer_direct off

#################################################################
# Cache & Object
#################################################################
cache_mem 6 MB
cache_swap_low 98
cache_swap_high 99
max_filedesc 8192
maximum_object_size 128 MB
minimum_object_size 0 KB
maximum_object_size_in_memory 32 KB
ipcache_size 4096
ipcache_low 98
ipcache_high 99
fqdncache_size 4096
cache_replacement_policy heap LFUDA
memory_replacement_policy heap GDSF

#################################################################
# cache_dir
#################################################################
cache_dir ufs /cache1 20000 46 256
cache_dir ufs /cache2 20000 46 256
cache_dir ufs /cache3 20000 46 256
cache_dir ufs /cache4 20000 46 256
cache_dir ufs /cache5 20000 46 256

cache_access_log /var/log/squid/access.log
cache_log /dev/null
cache_store_log /dev/null
pid_filename /var/run/squid.pid
cache_swap_log /var/log/squid/swap.state
dns_nameservers 127.0.0.1 202.148.1.195 202.148.1.196 8.8.8.8
emulate_httpd_log off
hosts_file /etc/hosts
half_closed_clients off
negative_ttl 1 minutes

#################################################################
# Rules: Safe Port
#################################################################
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 563 873 # https snews rsync
acl Safe_ports port 80 # http
acl Safe_ports port 20 21 # ftp
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 631 # cups
acl Safe_ports port 10000 # webmin
acl Safe_ports port 901 # SWAT
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl Safe_ports port 873 # rsync
acl Safe_ports port 110 # POP3
acl Safe_ports port 25 # SMTP
acl Safe_ports port 2095 2096 # webmail from cpanel
acl Safe_ports port 2082 2083 # cpanel
acl purge method PURGE
acl CONNECT method CONNECT
#acl malware url_regex -i "/etc/squid/malware_block.txt"
acl ie_browser browser ^Mozilla/4\.0 .compatible; MSIE # STOP IE browser & ultrasurf
acl bad_browser browser ^Gator # Gator is also crap!
acl ie_exceptions dstdomain .nyata.co.id

# bloking UltraSurf/Skype
acl numeric_IPs url_regex ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+


http_access deny CONNECT numeric_IPs all
http_access deny bad_browser
http_access allow ie_exceptions
http_access deny ie_browser
#http_access deny malware
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports !SSL_ports
http_access deny CONNECT !SSL_ports !Safe_ports

#################################################################
# Refresh Pattern
#################################################################

refresh_pattern ^ftp: 1440 50% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern (Release|Package(.gz)*)$ 0 80% 2880
refresh_pattern -i .(jpg|png|jpeg|bmp|gif)$ 10240 90% 43200 override-expire
refresh_pattern -i .(deb|rpm|tgz|bz2|tar|gz)$ 10240 100% 43200 override-expire
refresh_pattern -i .(class|css|js|gif|jpg)$ 10080 90% 43200 override-expire
refresh_pattern -i .(jpe|jpeg|png|bmp|tif)$ 10080 90% 43200 override-expire
refresh_pattern -i .(tiff|qt)$ 10080 90% 43200 override-expire
refresh_pattern -i .(gz|arj|lha|lzh)$ 10080 90% 43200 override-expire
refresh_pattern -i .(rar|tgz|tar|bin)$ 10080 90% 43200 override-expire
refresh_pattern -i .(hqx|pdf|rtf|doc|swf)$ 10080 90% 43200 override-expire
refresh_pattern -i .(inc|cab|ad|txt|dll)$ 10080 90% 43200 override-expire
refresh_pattern -i .(asp|acgi|pl|shtml|php3|php)$ 2 20% 4320 reload-into-ims
#refresh_pattern . 0 80% 4320


#################################################################
# HAVP + Clamav
#################################################################
cache_peer 127.0.0.1 parent 3128 0 no-query no-digest no-netdb-exchange default


#################################################################
# HIERARCHY (BYPASS CGI)
#################################################################
#hierarchy_stoplist cgi-bin ? .js .jsp
#acl QUERY urlpath_regex cgi-bin \? .js .jsp
#no_cache deny QUERY


#################################################################
# SNMP
#################################################################
snmp_port 3401
acl snmpsquid snmp_community public
snmp_access allow snmpsquid localhost
snmp_access deny all


#################################################################
# ALLOWED ACCESS
#################################################################
# HTTP OPTIONS
# ###############################################################

acl QUERY urlpath_regex cgi-bin \?
acl apache rep_header Server ^Apache
#acl Sos-Net url_regex -i "/etc/squid/sosial.txt"
acl Waktu-kerja time MTWHFA 07:30-11:30
acl Web-sehat dstdom_regex -i vivanews liputan6 okenews metro tv trans hotmail google gmail yahoo pajak depkeu
acl Waktu-kerja time MTWHFA 11:35-22:00

acl VVIP src 172.16.10.7 172.16.10.18 172.16.10.42 172.16.10.102
acl All-Website dst 0.0.0.0/0.0.0.0
acl VIP src 172.16.10.0/25
acl To-Lokal-Server dst 202.127.107.226-202.127.107.230 202.51.103.114-202.51.103.118 192.167.1.1-192.167.1.2 202.148.22.210-202.148.22.216
acl Lokal-LAN src 172.16.10.0/25

acl Webmin port 10000
acl File-Multimedia url_regex -i \.3gp \.ac3 \.aif \.aifc \.aiff \.asf \.au \.avi \.dat \.div \.divx \.dts \.dvr-ms \.flv \.m1v \.m2v \.mid \.midi \.mkv \.mp2 \.mp2v \.mp3 \.mp4 \.mpa \.mpe \.mpeg \.mpg \.mpv2 \.qt \.ram \.raw \.rm \.rmi \.rmvb \.snd \.vob \.vqf \.vro \.wav \.wma \.wmv \.rar
acl File-Pics url_regex -i \.srf \.tga \.tif \.tiff \.tif \.ttf \.hdf \.wbmp \.wmf \.x3f \.xbm \.xpm \.cr2 \.crw \.dcr \.djvu \.emf \.eps \.fpx \.icl \.icn \.iff \.jp2 \.jpc \.mrw \.nef \.orf \.pbm \.pcd \.pcx \.pef \.pgm \.pic \.pict \.plp \.ppm \.psd \.psp \.raf \.ras \.raw \.rs \.sgi
#acl File-Execute url_regex -i \.exe \.msi \.rpm \.bin
acl Waktu-Jumat time F 08:00-16:00
## acl Lokal-DHCP src 192.168.1.0-192.168.1.254
## acl Web-Refresh dstdom_regex -i facebook.com detik.com
## acl Streaming url_regex youtube
acl Other dstdom_regex -i livescore
acl src_ip_me src 192.168.100.122
acl Porn-url url_regex -i "/etc/squid/porn.txt"


## cache deny QUERY Web-Refresh
## log_access deny src_ip_me
http_access deny !Lokal-LAN

http_access allow VVIP
http_access deny Porn-url
#http_access deny Sos-Net
http_access deny !Safe_ports
#http_access deny File-Execute
http_access deny File-Multimedia
http_access deny Other
http_access allow VIP
http_access allow Web-sehat
http_access deny !Waktu-kerja
## http_access deny Streaming
http_access allow !Waktu-kerja
## http_access deny Lokal-DHCP
http_access allow Webmin
http_access allow To-Lokal-Server
http_access deny All-Website
http_access deny all
broken_vary_encoding allow apache

# ie_refresh off
# vary_ignore_expire off
#extension_methods OPTIONS PROPFIND REPORT MERGE MKACTIVITY CHECKOUT

###############################################################################
# Extra Additional
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.0.0.0/8 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network

follow_x_forwarded_for allow localnet
follow_x_forwarded_for allow localhost

tcp_outgoing_tos 0x30 localnet
zph_mode tos
zph_local 0x30
zph_parent 0
zph_option 136



################################################################
# ADVANCED NETWORKING OPTIONS
# -----------------------------------------------------------------------------
header_access Accept-Encoding deny all
client_persistent_connections off
server_persistent_connections on
half_closed_clients off
strip_query_terms off
quick_abort_min 0 KB
quick_abort_max 0 KB
quick_abort_pct 100
vary_ignore_expire on
reload_into_ims on
pipeline_prefetch on
range_offset_limit 512 KB
read_timeout 30 minutes
client_lifetime 6 hours
negative_ttl 30 seconds
positive_dns_ttl 6 hours
negative_dns_ttl 60 seconds
pconn_timeout 15 seconds
request_timeout 1 minute
store_avg_object_size 13 KB
log_icp_queries off
ipcache_size 16384
ipcache_low 98
ipcache_high 99
log_fqdn off
fqdncache_size 16384
memory_pools off
forwarded_for on
max_filedescriptors 8192

#################################################################
# Cache CGI & Administrative
#################################################################
cache_mgr bangnapi
visible_hostname bangnapi
cache_effective_user proxy
cache_effective_group proxy
coredump_dir /var/spool/squid
shutdown_lifetime 10 seconds
logfile_rotate 1


redirect_program /usr/local/bin/squidGuard -c /usr/local/squidGuard/squidGuard.conf
redirect_children 10
useragent_log /var/log/squid/usragent.log


Proses yang berjalan apache2, lightsquid, squidguard dan webmin
kondisi saat pesan ini diketik;

#free
total used free shared buffers cached
Mem: 4047216 3860644 186572 0 319040 2735860
-/+ buffers/cache: 805744 3241472
Swap: 3905532 160 3905372

Proses menjadi makin lambat ketika swap sudah mulai terpakai ??

mohon bantuan analisanya..

TKS
klo menurut gw sich

HAVP + Clamav ga' usah dipake toh dah ada squidguard selebihnya bisa ditangani oleh av yg terpasang di kompi client masing2...mending sich ga' usah dipakein clamav :D

konfigurasi squid koq acak2an y gw liatnya...inget rules squid berjalan dari atas ke bawah..jadi mesti bener2 diperhatikan..

cache dir banyak partisi itu apakah dalam 1 HDD aja..klo iya lebih baek dibuat satu aja..banyak partisi akan sia2 kecuali banyak partisi cache = jumlah HDD

untuk log mungkin bs mempertimbangkan memakai sqstat

http://samm.kiev.ua/sqstat/

ato sarg

sarg - Squid Analysis Report Generator is a tool that allow you to view "where" your users are going to on the Internet.
Sarg provides many informations about Squid users activities: times, bytes, sites, etc...

tambahkan aplikasi bwstat, dan jnettop dimana bwstat digunakan untuk melihat berapa bandwidth yang sudah dihabiskan per IP dan jnettop digunakan untuk melihat IP mana yang sedang download secara real-time. Sedangkan SARG dan lightsquid untuk melihat akumulatif bandwidth per hari.
User avatar
upik
Posts: 99
Joined: 05 Jun 2010, 14:52

Re: [ask] kenapa server nyaris kehabisan memory ???

Postby upik » 29 Nov 2010, 15:32

Pak

Mohon saran terbaiknya bagaimana Pak ?? ketika saya jalankan dengan cache_dir 100000 234 256..divonis salah oleh beberapa rekan saya, tapi ketika saya minta input, katanya cari aja di google. Setelah saya mengikuti beberapa cara di google, ternyata masih salah juga. Kira2 sebaiknya bagaimana ya ?

Lalu squid.conf saya yang berantakan itu di bagian mana ya pak? supaya bisa saya rapikan. semoga tidak keberatan memberikan masukan lebih lanjut.

tks
User avatar
MasDjo
Posts: 1260
Joined: 03 Jan 2010, 17:38
Location: Bayuangga City
Contact:

Re: [ask] kenapa server nyaris kehabisan memory ???

Postby MasDjo » 29 Nov 2010, 16:23

Sama kok dg yg saya pakai, rumus cache dir sbb :

Code: Select all

 (((x / 13) / 256) / 256) * 2

misal : ukuran cache = x = 12 GB ---- 12 GB = 12.000.000 KB
=> 12000000/13/256/256 x 2 = 28.17 dibulatkan mjd = 28
shg cache dir mjd =
cache_dir aufs /proxy1 12000 28 256

/proxy1 adl nama partisi utk cache-squid saya :)

Apa mungkin karena banyaknya ruang cache ya shg memory jadi full, di configurasi tertera 5 buah cache dir yg masing2 20 GB = 100 GB.
kalau gak salah ada tuh kebutuhan memory per KB/MB cache, tapi saya lupa :grin: mungkin para mastah squid bisa memberi penjelasan :)
User avatar
Rh354
Posts: 718
Joined: 14 Mar 2010, 19:56
Location: between the truth and the lies
Contact:

Re: [ask] kenapa server nyaris kehabisan memory ???

Postby Rh354 » 01 Dec 2010, 11:53

upik wrote:Pak

Mohon saran terbaiknya bagaimana Pak ?? ketika saya jalankan dengan cache_dir 100000 234 256..divonis salah oleh beberapa rekan saya, tapi ketika saya minta input, katanya cari aja di google. Setelah saya mengikuti beberapa cara di google, ternyata masih salah juga. Kira2 sebaiknya bagaimana ya ?

Lalu squid.conf saya yang berantakan itu di bagian mana ya pak? supaya bisa saya rapikan. semoga tidak keberatan memberikan masukan lebih lanjut.

tks
mo tanya dl nich sebelumnya

HDD ada berapa lalu tipe HDD apakah SATA ato IDE

gw kasih clue dikit

Code: Select all

Hal yang perlu di ingat adalah jangan membuat cache dir lebih dari 20GB per partisi mengingat spindle head HDD demi terjaganya aliran data. (kecuali SCSI HDD bisa dibuat maksimal 100GB per partisi)



saran terbaik cari HDD laen yg kecil sizenya (misal 20-40Gb) tp banyak (misal 3-4) :D

gw bantu jelasin lagi ya soal cache_mem, :

cache_mem
Option Name: cache_mem
Replaces:
Requires:
Default Value: cache_mem 8 MB
Suggested Config:

NOTE: THIS PARAMETER DOES NOT SPECIFY THE MAXIMUM PROCESS SIZE.
IT ONLY PLACES A LIMIT ON HOW MUCH ADDITIONAL MEMORY SQUID WILL
USE AS A MEMORY CACHE OF OBJECTS. SQUID USES MEMORY FOR OTHER
THINGS AS WELL. SEE THE SQUID FAQ SECTION 8 FOR DETAILS.

'cache_mem' specifies the ideal amount of memory to be used
for:
* In-Transit objects
* Hot Objects
* Negative-Cached objects


Data for these objects are stored in 4 KB blocks. This
parameter specifies the ideal upper limit on the total size of
4 KB blocks allocated. In-Transit objects take the highest
priority.

In-transit objects have priority over the others. When
additional space is needed for incoming data, negative-cached
and hot objects will be released. In other words, the
negative-cached and hot objects will fill up any unused space
not needed for in-transit objects.

If circumstances require, this limit will be exceeded.
Specifically, if your incoming request rate requires more than
'cache_mem' of memory to hold in-transit objects, Squid will
exceed this limit to satisfy the new requests. When the load
decreases, blocks will be freed until the high-water mark is
reached. Thereafter, blocks will be used to store hot
objects.


cache_mem
cache_mem

This is one of the top two options as far as performance impact goes. The default value here is 8 MB, which is a safe option for just about any system size. But since your box is not lacking in memory it can safely be raised to 32 MB, and even 48 if you have stripped all other services off of your server. If your box is lacking in memory, go back to the hardware section and reread the part about memory...you need a bunch of memory for a fast web cache. You should be aware that cache_mem does not limit the process size of squid. This sets how much memory squid is allowed to set aside for "hot objects" which are the most recently used objects. Having said all that, keep in mind that the buffer cache in Linux is also quite good, so the gains you'll see by raising this are very small, but still measurable.


RAM
RAM

It's pretty easy to calculate the amount of RAM needed for any given web cache. A safe number is 10MB RAM for every 1 GB of cache space on disk. I usually allot a little more than this when using a threaded Squid. Of course, you also need to figure out what your system uses for other things and subtract that from the total of available RAM.


How much memory do I need in my Squid server?

As a rule of thumb on Squid uses approximately 10 MB of RAM per GB of the total of all cache_dirs (more on 64 bit servers such as Alpha), plus your cache_mem setting and about an additional 10-20MB. It is recommended to have at least twice this amount of physical RAM available on your Squid server. For a more detailed discussion on Squid's memory usage see the sections above.

The recommended extra RAM besides what is used by Squid is used by the operating system to improve disk I/O performance and by other applications or services running on the server. This will be true even of a server which runs Squid as the only tcp service, since there is a minimum level of memory needed for process management, logging, and other OS level routines.

If you have a low memory server, and a large disk, then you will not necessarily be able to use all the disk space, since as the cache fills the memory available will be insufficient, forcing Squid to swap out memory and affecting performance. A very large cache_dir total and insufficient physical RAM + Swap could cause Squid to stop functioning completely. The solution for larger caches is to get more physical RAM; allocating more to Squid via cache_mem will not help.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Penjelasan dalam bahasa manusia

Penggunaan RAM
cache_dir dan RAM hubungannya erat, mengalokasikan cache_dir tanpa mempertimbangkan ketersediaan phisical memory jg berakibat fatal. cache_dir tergantung sisa kapasitas yang tidak terpakai pada HDD dan setiap GB yang dialokasikan untuk cache_dir membutuhkan penggunaan memory sekitar 10 MB serta tambahan 10 - 20MB.

contoh :
cache_dir = 1GB butuh RAM sebesar 10MB + 20MB = 30MB
cache_dir = 5GB butuh RAM sebesar 50MB + 20MB = 70MB

cache_mem????
cache_mem untuk menyimpan "hot object" yang relatif berukuran kecil dan paling sering di akses, besar object ditentukan oleh maximum_object_size_in_memory jika lebih dari itu maka akan tersimpan di cache_dir

cache_mem juga digunakan untuk penyimpanan object2 yang sedang ditransfer sampai dengan pemilihan apakah object tersebut disimpan ato tidak pada cache disk, jika maximum_object_size terpenuhi, maka akan disimpan di cache_dir.

untuk selengkapnya silahkan baca squid F.A.Q misalnya di :

Code: Select all

http://www.comfsm.fm/computing/squid/FAQ-8.html


oya tambahan dari gw buat DNS server tp klo masalah squid ini dah selese aja br dipikirkan ke arah sana..

btw konfigurasi itu menyesuaikan daerah lo..saran gw coba settingan minimal dl baru di tambah..misalnya dengan penambahan delaypools
User avatar
freak_geek
Posts: 2
Joined: 19 Apr 2012, 14:49
Location: malang
Contact:

Re: [ask] kenapa server nyaris kehabisan memory ???

Postby freak_geek » 19 Apr 2012, 15:01

apakah install squid / proxi bisa berguna untuk web cache bagi laptop yang hanya sebagai client??

Return to “Ubuntu Server”

Who is online

Users browsing this forum: No registered users and 4 guests