ALT Linux sysadmins discussion
 help / color / mirror / Atom feed
From: Michael Shigorin <mike@osdn.org.ua>
To: sysadmins@lists.altlinux.org
Subject: Re: [Sysadmins] ovz контейнер & LAMP
Date: Fri, 7 Aug 2009 18:43:07 +0300
Message-ID: <20090807154307.GM6046@osdn.org.ua> (raw)
In-Reply-To: <20090807192340.6897dfe9@lynx>

On Fri, Aug 07, 2009 at 07:23:40PM +0400, Maks Re wrote:
> есть необходимость развернуть для друпала платформу ( apache2,
> mysqld, php5 etc)
> особенности - памяти в контейнере всего 256, и лимиты соответственно.
> вопрос - что посоветуете, как побороться, что
> настроить-урезать-заточить,  чтобы все влезло в существующие
> лимиты и хватало при нагрузке..

s/apache2/apache/ (может, тогда хватит ещё и на eaccelerator)

Ну и выслать mysqld в Сибирь примерно таким образом
(после того, как заработает -- можно потихоньку поднимать,
начиная с table_cache и sort_buffer_size):

---
## http://paragasu.wordpress.com/2008/12/02/very-low-memory-mysql-5-mycnf-configuration/
# Set internal buffers, caches and stacks very low
key_buffer = 16K
max_allowed_packet = 16K
table_cache = 1
sort_buffer_size = 16K
read_buffer_size = 16K
read_rnd_buffer_size = 1K
net_buffer_length = 1K
thread_stack = 16K

# Skip Berkley and Inno DB types
skip-bdb
skip-innodb

skip-networking
server-id = 1

# Set the query cache low
query_cache_limit = 1048576
query_cache_size = 1048576
query_cache_type = 1

# Set various memory limits very low, disable memory-hogging extras
[mysqldump]
quick
max_allowed_packet = 16K

[mysql]
no-auto-rehash

[isamchk]
key_buffer = 16K
sort_buffer_size = 16K

[myisamchk]
key_buffer = 16K
sort_buffer_size = 16K

[mysqlhotcopy]
interactive-timeout
---

В таком виде может получиться примерно так:

32165 root      15   0 26856 8288 3944 S  0.0  1.9   0:10.16 libhttpd.ep                                                
24519 apache    18   0 27160 5644 1232 S  0.0  1.3   0:00.02 libhttpd.ep                                                
24518 apache    18   0 27160 5636 1224 S  0.0  1.3   0:00.01 libhttpd.ep                                                
31830 mysql     35  10 23160 4852 3912 S  0.0  1.1   0:00.02 mysqld

(это при eaccelerator.shm_size = "4", что много лучше,
чем без него)

-- 
 ---- WBR, Michael Shigorin <mike@altlinux.ru>
  ------ Linux.Kiev http://www.linux.kiev.ua/


  reply	other threads:[~2009-08-07 15:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-07 15:23 Maks Re
2009-08-07 15:43 ` Michael Shigorin [this message]
2009-08-07 15:51   ` Maks Re
2009-08-07 16:46     ` Michael Shigorin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090807154307.GM6046@osdn.org.ua \
    --to=mike@osdn.org.ua \
    --cc=shigorin@gmail.com \
    --cc=sysadmins@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux sysadmins discussion

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sysadmins/0 sysadmins/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 sysadmins sysadmins/ http://lore.altlinux.org/sysadmins \
		sysadmins@lists.altlinux.org sysadmins@lists.altlinux.ru sysadmins@lists.altlinux.com
	public-inbox-index sysadmins

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.sysadmins


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git