Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: obciążenie pamięci VPS
Forum PHP.pl > Forum > Serwery WWW
Swirek
Witam

posiadam VPS-a skonfigurowałem na nim LAMP zainstalowałem dodatkowo iredadmin, aby prosto obsługiwać poczty. Dodatkowo wrzuciłem również webmina, korzystam z postfixa do wysyłania poczty.
niestety mam problem z zżeraniem pamięci przez serwer

posortowany według użycia wykres zużycia pamięci



komenda free -m

total used free shared buffers cached
Mem: 1024 834 189 0 0 0
-/+ buffers/cache: 834 189
Swap: 0 0 0

wyłączyłem bazę postgresql, ale chciałbym ją jednak uruchomić

system debian-6.0-x86_64 pamięć 1giga procek 2000mhz
memory limit w php ini 128mb

apache2.conf

  1. #
  2. # Based upon the NCSA server configuration files originally by Rob McCool.
  3. #
  4. # This is the main Apache server configuration file. It contains the
  5. # configuration directives that give the server its instructions.
  6. # See <a href="http://httpd.apache.org/docs/2.2/" target="_blank">http://httpd.apache.org/docs/2.2/</a> for detailed information about
  7. # the directives.
  8. #
  9. # Do NOT simply read the instructions in here without understanding
  10. # what they do. They're here only as hints or reminders. If you are unsure
  11. # consult the online docs. You have been warned.
  12. #
  13. # The configuration directives are grouped into three basic sections:
  14. # 1. Directives that control the operation of the Apache server process as a
  15. # whole (the 'global environment').
  16. # 2. Directives that define the parameters of the 'main' or 'default' server,
  17. # which responds to requests that aren't handled by a virtual host.
  18. # These directives also provide default values for the settings
  19. # of all virtual hosts.
  20. # 3. Settings for virtual hosts, which allow Web requests to be sent to
  21. # different IP addresses or hostnames and have them handled by the
  22. # same Apache server process.
  23. #
  24. # Configuration and logfile names: If the filenames you specify for many
  25. # of the server's control files begin with "/" (or "drive:/" for Win32), the
  26. # server will use that explicit path. If the filenames do *not* begin
  27. # with "/", the value of ServerRoot is prepended -- so "foo.log"
  28. # with ServerRoot set to "/etc/apache2" will be interpreted by the
  29. # server as "/etc/apache2/foo.log".
  30. #
  31.  
  32. ### Section 1: Global Environment
  33. #
  34. # The directives in this section affect the overall operation of Apache,
  35. # such as the number of concurrent requests it can handle or where it
  36. # can find its configuration files.
  37. #
  38.  
  39. #
  40. # ServerRoot: The top of the directory tree under which the server's
  41. # configuration, error, and log files are kept.
  42. #
  43. # NOTE! If you intend to place this on an NFS (or otherwise network)
  44. # mounted filesystem then please read the LockFile documentation (available
  45. # at <URL:http://httpd.apache.org/docs/2.2/mod/mpm_common.html#lockfile>);
  46. # you will save yourself a lot of trouble.
  47. #
  48. # Do NOT add a slash at the end of the directory path.
  49. #
  50. #ServerRoot "/etc/apache2"
  51.  
  52. #
  53. # The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
  54. #
  55. LockFile ${APACHE_LOCK_DIR}/accept.lock
  56.  
  57. #
  58. # PidFile: The file in which the server should record its process
  59. # identification number when it starts.
  60. # This needs to be set in /etc/apache2/envvars
  61. #
  62. PidFile ${APACHE_PID_FILE}
  63.  
  64. #
  65. # Timeout: The number of seconds before receives and sends time out.
  66. #
  67. Timeout 300
  68.  
  69. #
  70. # KeepAlive: Whether or not to allow persistent connections (more than
  71. # one request per connection). Set to "Off" to deactivate.
  72. #
  73. KeepAlive Off
  74.  
  75. #
  76. # MaxKeepAliveRequests: The maximum number of requests to allow
  77. # during a persistent connection. Set to 0 to allow an unlimited amount.
  78. # We recommend you leave this number high, for maximum performance.
  79. #
  80. MaxKeepAliveRequests 100
  81.  
  82. #
  83. # KeepAliveTimeout: Number of seconds to wait for the next request from the
  84. # same client on the same connection.
  85. #
  86. KeepAliveTimeout 15
  87.  
  88. ##
  89. ## Server-Pool Size Regulation (MPM specific)
  90. ##
  91.  
  92. # prefork MPM
  93. # StartServers: number of server processes to start
  94. # MinSpareServers: minimum number of server processes which are kept spare
  95. # MaxSpareServers: maximum number of server processes which are kept spare
  96. # MaxClients: maximum number of server processes allowed to start
  97. # MaxRequestsPerChild: maximum number of requests a server process serves
  98. <IfModule mpm_prefork_module>
  99. StartServers 1
  100. MinSpareServers 1
  101. MaxSpareServers 5
  102. MaxClients 150
  103. MaxRequestsPerChild 0
  104. </IfModule>
  105.  
  106. # worker MPM
  107. # StartServers: initial number of server processes to start
  108. # MaxClients: maximum number of simultaneous client connections
  109. # MinSpareThreads: minimum number of worker threads which are kept spare
  110. # MaxSpareThreads: maximum number of worker threads which are kept spare
  111. # ThreadLimit: ThreadsPerChild can be changed to this maximum value during a
  112. # graceful restart. ThreadLimit can only be changed by stopping
  113. # and starting Apache.
  114. # ThreadsPerChild: constant number of worker threads in each server process
  115. # MaxRequestsPerChild: maximum number of requests a server process serves
  116. <IfModule mpm_worker_module>
  117. StartServers 1
  118. MinSpareThreads 5
  119. MaxSpareThreads 10
  120. ThreadLimit 64
  121. ThreadsPerChild 25
  122. MaxClients 150
  123. MaxRequestsPerChild 0
  124. </IfModule>
  125.  
  126. # event MPM
  127. # StartServers: initial number of server processes to start
  128. # MaxClients: maximum number of simultaneous client connections
  129. # MinSpareThreads: minimum number of worker threads which are kept spare
  130. # MaxSpareThreads: maximum number of worker threads which are kept spare
  131. # ThreadsPerChild: constant number of worker threads in each server process
  132. # MaxRequestsPerChild: maximum number of requests a server process serves
  133. <IfModule mpm_event_module>
  134. StartServers 1
  135. MinSpareThreads 5
  136. MaxSpareThreads 10
  137. ThreadLimit 64
  138. ThreadsPerChild 25
  139. MaxClients 150
  140. MaxRequestsPerChild 0
  141. </IfModule>
  142.  
  143. # These need to be set in /etc/apache2/envvars
  144. User ${APACHE_RUN_USER}
  145. Group ${APACHE_RUN_GROUP}
  146.  
  147. #
  148. # AccessFileName: The name of the file to look for in each directory
  149. # for additional configuration directives. See also the AllowOverride
  150. # directive.
  151. #
  152.  
  153. AccessFileName .htaccess
  154.  
  155. #
  156. # The following lines prevent .htaccess and .htpasswd files from being
  157. # viewed by Web clients.
  158. #
  159. <Files ~ "^\.ht">
  160. Order allow,deny
  161. Deny from all
  162. Satisfy all
  163. </Files>
  164.  
  165. #
  166. # DefaultType is the default MIME type the server will use for a document
  167. # if it cannot otherwise determine one, such as from filename extensions.
  168. # If your server contains mostly text or HTML documents, "text/plain" is
  169. # a good value. If most of your content is binary, such as applications
  170. # or images, you may want to use "application/octet-stream" instead to
  171. # keep browsers from trying to display binary files as though they are
  172. # text.
  173. #
  174. DefaultType text/plain
  175.  
  176.  
  177. #
  178. # HostnameLookups: Log the names of clients or just their IP addresses
  179. # e.g., www.apache.org (on) or 204.62.129.132 (off).
  180. # The default is off because it'd be overall better for the net if people
  181. # had to knowingly turn this feature on, since enabling it means that
  182. # each client request will result in AT LEAST one lookup request to the
  183. # nameserver.
  184. #
  185. HostnameLookups Off
  186.  
  187. # ErrorLog: The location of the error log file.
  188. # If you do not specify an ErrorLog directive within a <VirtualHost>
  189. # container, error messages relating to that virtual host will be
  190. # logged here. If you *do* define an error logfile for a <VirtualHost>
  191. # container, that host's errors will be logged there and not here.
  192. #
  193. ErrorLog ${APACHE_LOG_DIR}/error.log
  194.  
  195. #
  196. # LogLevel: Control the number of messages logged to the error_log.
  197. # Possible values include: debug, info, notice, warn, error, crit,
  198. # alert, emerg.
  199. #
  200. LogLevel warn
  201.  
  202. # Include module configuration:
  203. Include mods-enabled/*.load
  204. Include mods-enabled/*.conf
  205.  
  206. # Include all the user configurations:
  207. Include httpd.conf
  208.  
  209. # Include ports listing
  210. Include ports.conf
  211.  
  212. #
  213. # The following directives define some format nicknames for use with
  214. # a CustomLog directive (see below).
  215. # If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
  216. #
  217. LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
  218. LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
  219. LogFormat "%h %l %u %t \"%r\" %>s %O" common
  220. LogFormat "%{Referer}i -> %U" referer
  221. LogFormat "%{User-agent}i" agent
  222.  
  223. # Include of directories ignores editors' and dpkg's backup files,
  224. # see README.Debian for details.
  225.  
  226. # Include generic snippets of statements
  227. Include conf.d/
  228.  
  229. # Include the virtual host configurations:
  230. Include sites-enabled/


Prośba o pomoc bo już sobie nie daje z tym rady. Jak trzeba coś podać jeszcze jakieś dane piszcie wrzucę je jak najszybciej
abort
Źródłem problemu jest poczta elektroniczna.
Wrzuciłeś zrzut z programu top - w dodatku ładnie posortowałeś po ilości pamięci zajętej przez procesy, od najbardziej żarłocznych na górze.

clamd, amavis (razy trzy!), bind (po co? robisz jako DNS dla domen?), miniserv.pl (razy dwa - jak już masz mieć webmina i apache, to dlaczego tego nie "pożenić"?), mysql (naprawdę musisz mieć zarówno postgresa jak i mysql? - tak, wiem: iRedAdmin)

Najwięcej pamięci zaoszczędzisz na umiejętnym zrekonfigurowaniu usług pocztowych. Do tego ileś oszczędzisz na łączeniu funkcjonalności (mysql i postgres czy też miniserv i Apache)
Niestety, iRedMail wygląda mi na dość spory kombajn ze wsparciem do wszystkiego (pytanie, czy tego PORZEBUJESZ, czy wrzuciłeś, bo "fajne, może użyję" albo "taki był default"). IMHO wsparcie do wszystkiego nie wszystkim jest potrzebne (zdecyduj się: LDAP czy MySQL - potrzeba obu naraz jest niezwykle rzadka)
Swirek
w zasadzie ldap wrzuciłem ponieważ przy instalacji właśnie redadmina i przy czytaniu jakiegoś tam poradnika był on zalecany.
wyłączyłem postgresa. Dlaczego te procesy mi się dublują? wiem, że to pytanie jest mało szczegółowe, ale choć sugestia w czym może tkwić problem albo jak Ty to ładnie napisałeś jak to pożenić. Proszę o wędke nie o ryby.
jeszcze kolejne pytanie laika czy rak naprawde potrzeby mi ten miniserv? czy moge to wywalic nie wyrzadzajac krzywdy apachowi i calej reszcie?

bardzo dziękuję Ci za pomoc

and please help again smile.gif

postanowiłem wywalić cały serwer i zrobić wszystko od nowa niż męczyć się z tym później bez przerwy.

mam jeden problem dlaczego przy łączeniu się po ssh mnoży mi procesy sshd: root@notty i /usr/lib/openssh/sftp-server

czego konsekwencją jest zapchanie serwera i restart aby go uruchomić. limit procesów zostaje osiągnięty i zapchany
abort
Kwestia "pożenienia" to jest zawsze bardzo indywidualna sprawa - nie wiem, czy jestem na tyle na bieżąco, by porywać się na pomoc. Ale jeśli naprawdę porzebujesz iredadmina, to może na ich forum coś znajdziesz? W przeciwnym wypadku możemy mówić o dwóch strategiach działania:
1. jeśli zrobienie czegoś takiego jest potrzebne "na już" - polecam zatrudnić fachowca, zapłacić i wymagać
2. jeśli kupiłeś serwer do czegoś innego, a to masz do wdrożenia w bliżej nieokreślonej przyszłości - warto zajrzeć na fora fachowców od danej grupy programów. To forum jest poświęcone PHP (więc siłą rzeczy także rzeczom pokrewnym: Apache, flash, JavaScript, bazy danych). To, że ja wiedziałem, gdzie jest problem, wcale nie oznacza, że będę umiał go rozwiązać...

Odnośnie ssh:
- jak (czym) się łączysz z tym serwerem? win+putty? Win+coś innego (co?) Linux?
- czy zdarzało Ci się, że podczas pracy via ssh straciłeś połączenie? Jeśli tak, to jak często?

Anyway, przydatny może być plik konfiguracyjny sshd (ma nazwę sshd_config, i dość typowe miejsce w którym może być, to katalog /etc/ssh)
Swirek
muszę najpierw znaleźć fachowca który mi to skonfiguruje choć wolał bym sam to zrobić bo jak nie zrobię tylko zapłacę to się nic nie nauczę smile.gif
chodzi mi tylko w zasadzie o pocztę bo apache i podstawowe rzeczy zjadają mi około 150mb razem doinstaluje to i zjada 800 ponad :/
a jest jakaś alternatywa dla radmina?
chodzi mi o założenie kilku skrzynek

na pytania

łącze się win przez ssh za pomocą putty
nie nie zdarza się tracić połączenia
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.