منتديات المجاوشي

منتديات المجاوشي (http://www.vb.mjawshy.net/index.php)
-   Arabic Rss (http://www.vb.mjawshy.net/forumdisplay.php?f=41)
-   -   مشكلة قواعد البيانات (http://www.vb.mjawshy.net/showthread.php?t=161685)

RSS 05-23-2011 01:22 PM

مشكلة قواعد البيانات
 
السلام عليكم ورحمة الله

لدي مشكلة في اللود على السيرفر من قواعد البيانات, واعرف الموقع المسبب للمشكله وجربت معه كل الحلول من تعطيل هاكات واصلاح لقاعدة البيانات..الخ"مع العلم ان الموقع يعتبر كبير" , الوضع يستقر لفتره ويعود مره اخرى, ولا اريد ايقافه
فهل من حل لتزبيط اعدادات قواعد البيانات بحيث اذا تعدى الموقع المسبب للود نسبه معينه من الموارد يتوقف او لا يستطيع تجاوزها؟ مع العلم اني ركبت برنامج cpulimit الذي يقوم بتحديد الموارد ولا يعمل حتى في الردود بالمواضيع لا يعمل مع الجميع

وايضا قمت بتركيب سكربت tuning-primer على السيرفر ليساعدني على ضبط اعدادات قواعد البيانات في my.cnf
وهذا جزء من التنبيهات المهمه الي اظهرها البرنامج

اقتباس:
MAX CONNECTIONS
Current max_connections = 300
Current threads_connected = 6
Historic max_used_connections = 23
The number of used connections is 7% of the configured maximum.
You are using less than 10% of your configured max_connections.
Lowering max_connections could help to avoid an over-allocation of memory
See "MEMORY USAGE" section to make sure you are not over-allocating


No InnoDB Support Enabled!

MEMORY USAGE
Max Memory Ever Allocated : 1.76 G
Configured Max Per-thread Buffers : 7.37 G
Configured Max Global Buffers : 1.19 G
Configured Max Memory Limit : 8.57 G
Physical Memory : 7.91 G

nMax memory limit exceeds 90% of physical memory
JOINS
Current join_buffer_size = 1.00 M
You have had 21 queries where a join could not use an index properly
You should enable "log-queries-not-using-indexes"
Then look for non indexed joins in the slow query log.
If you are unable to optimize your queries you may want to increase your
join_buffer_size to accommodate larger joins in one pass.

Note! This script will still suggest raising the join_buffer_size when
ANY joins not using indexes are found.


OPEN FILES LIMIT
Current open_files_limit = 12592 files
The open_files_limit should typically be set to at least 2x-3x
that of table_cache if you have heavy MyISAM usage.
You currently have open more than 75% of your open_files_limit
You should set a higher value for open_files_limit in my.cnf

TABLE CACHE
Current table_open_cache = 6141 tables
Current table_definition_cache = 556 tables
You have a total of 6141 tables
You have 6141 open tables.
Current table_cache hit rate is 34%
, while 100% of your table cache is in use
You should probably increase your table_cache
You should probably increase your table_definition_cache value

وهذه اعدادات my.cnf

رمز PHP:
[mysqld]
set-variable=local-infile=0
local
-infile=0
datadir
=/var/lib/mysql
skip
-locking
skip
-innodb
#skip-networking
safe-show-database
query_cache_limit
=1M
query_cache_size
=200M ## 32MB for every 1GB of RAM
query_cache_type=1
max_user_connections
=200
max_connections
=300
interactive_timeout
=200
wait_timeout
=60
connect_timeout
=20
thread_cache_size
=30
table_lock_wait_timeout
=60
key_buffer
=1024M ## 128MB for every 1GB of RAM
join_buffer=1M
max_connect_errors
=20
max_allowed_packet
=30M
table_cache
=6141
table_definition_cache
= 556
record_buffer
=1M
sort_buffer_size
=8M ## 1MB for every 1GB of RAM
read_buffer_size=8M ## 1MB for every 1GB of RAM
read_rnd_buffer_size=8M ## 1MB for every 1GB of RAM
thread_concurrency=6 ## Number of CPUs x 2
myisam_sort_buffer_size=64M
server
-id=1
collation
-server=latin1_general_ci
[mysql.server]
user=mysql
[safe_mysqld]
err-log=/var/log/mysqld.log
pid
-file=/var/lib/mysql/mysql.pid
open_files_limit
=8192
[mysqldump]
quick
max_allowed_packet
=512M
[mysql]
no-auto-rehash
#safe-updates
[isamchk]
key_buffer=16M
sort_buffer
=16M
read_buffer
=16M
write_buffer
=16M
[myisamchk]
key_buffer=16M
sort_buffer
=16M
read_buffer
=16M
write_buffer
=16M
[mysqlhotcopy]
interactive-timeout
safe
-show-database
set
-variable=local-infile=0



log_slow_queries
=/var/log/mysql_slow.log
long_query_time
=60


اتمنى من احد الخبراء مراجعتها واخباري بالمطلوب تعديله
مع العلم ان هذه هي مواصفات السيرفر
رمز PHP:
Total processors: 4 Processor #1VendorGenuineIntel NameIntel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz Speed2394.033 MHz Cache4096 KB Processor #2VendorGenuineIntel NameIntel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz Speed2394.033 MHz Cache4096 KB Processor #3VendorGenuineIntel NameIntel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz Speed2394.033 MHz Cache4096 KB Processor #4VendorGenuineIntel NameIntel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz Speed2394.033 MHz Cache4096 KB


والرامات 8 جيجا

وايضا المتصلين في وقت واحد لا يتعدى 550
وهذا من استخدام الامر
اقتباس:
netstat -an | grep :80 | wc -l
وغالبا يكون متوسط 350 متصل
وايضا فيما يخص اعدادات الاباتشي
RLimitMEM
RLimitCPU
ماهو الاعداد الصحيح لها؟

وايضا هل هناك اعدادات معينه في php.ini تساعد في تقليل اللود؟

اتمنى ان اجد الرد وشكرا







أكثر...


الساعة الآن 03:09 AM

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd. منتديات بلاك بيري mjawshy.net
المجاوشي للتقنية المتقدمة