• 26-11-2015, 15:45:12
    #1
    Merhaba arkadaslar,
    sitem bu aralar anlik 100 online görünce ne yapacagini sasiriyor. Site 10 saniyeden evvel acilmiyor. Aklima gelen ilk secenek MySql oldu.

    Sitem bilgileri
    2 CPU vCores
    4 GB RAM
    300 GB SSD/HDD


    terminal üstünden MysqlTurner i calistirdigimda

    Resim url : http://prntscr.com/975ry6 bu sonucu aliyorum.

    My.cnf dosyam ise bu sekilde.
    # Run program with --help to get a list of available options and with
    # --print-defaults to see which it would actually understand and use.
    #
    # For explanations see
    # http://dev.mysql.com/doc/mysql/en/server-system-variables.html
    
    # This will be passed to all mysql clients
    # It has been reported that passwords should be enclosed with ticks/quotes
    # escpecially if they contain "#" chars...
    # Remember to edit /etc/mysql/debian.cnf when changing the socket location.
    [client]
    port		= 3306
    socket		= /var/run/mysqld/mysqld.sock
    
    # Here is entries for some specific programs
    # The following values assume you have at least 32M ram
    
    # This was formally known as [safe_mysqld]. Both versions are currently parsed.
    [mysqld_safe]
    socket		= /var/run/mysqld/mysqld.sock
    nice		= 0
    
    innodb_buffer_pool_size=368M
    innodb_additional_mem_pool_size=500K
    innodb_log_buffer_size=500K
    innodb_thread_concurrency=2
    [mysqld]
    bind-address = ::
    skip_name_resolve
    local-infile=0
    #
    # * Basic Settings
    #
    innodb_use_native_aio = 0
    user		= mysql
    pid-file	= /var/run/mysqld/mysqld.pid
    socket		= /var/run/mysqld/mysqld.sock
    port		= 3306
    basedir		= /usr
    datadir		= /var/lib/mysql
    tmpdir		= /tmp
    lc-messages-dir	= /usr/share/mysql
    skip-external-locking
    #
    # Instead of skip-networking the default is now to listen only on
    # localhost which is more compatible and is not less secure.
    #
    # * Fine Tuning
    #
    key_buffer		= 16M
    max_allowed_packet	= 16M
    thread_stack		= 192K
    thread_cache_size       = 8
    # This replaces the startup script and checks MyISAM tables if needed
    # the first time they are touched
    myisam-recover         = BACKUP
    max_connections        = 250
    table_cache            = 64
    table_open_cache       =  
    #thread_concurrency     = 10
    #
    # * Query Cache Configuration
    #
    query_cache_limit	= 1M
    query_cache_size        = 16M
    #
    # * Logging and Replication
    #
    # Both location gets rotated by the cronjob.
    # Be aware that this log type is a performance killer.
    # As of 5.1 you can enable the log at runtime!
    #general_log_file        = /var/log/mysql/mysql.log
    #general_log             = 1
    #
    # Error log - should be very few entries.
    #
    log_error = /var/log/mysql/error.log
    #
    # Here you can see queries with especially long duration
    #log_slow_queries	= /var/log/mysql/mysql-slow.log
    #long_query_time = 2
    #log-queries-not-using-indexes
    #
    # The following can be used as easy to replay backup logs or for replication.
    # note: if you are setting up a replication slave, see README.Debian about
    #       other settings you may need to change.
    #server-id		= 1
    #log_bin			= /var/log/mysql/mysql-bin.log
    expire_logs_days	= 10
    max_binlog_size         = 100M
    #binlog_do_db		= include_database_name
    #binlog_ignore_db	= include_database_name
    #
    # * InnoDB
    #
    # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
    # Read the manual for more InnoDB related options. There are many!
    #
    # * Security Features
    #
    # Read the manual, too, if you want chroot!
    # chroot = /var/lib/mysql/
    #
    # For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
    #
    # ssl-ca=/etc/mysql/cacert.pem
    # ssl-cert=/etc/mysql/server-cert.pem
    # ssl-key=/etc/mysql/server-key.pem
    
    
    
    innodb_buffer_pool_size=368M
    innodb_additional_mem_pool_size=500K
    innodb_log_buffer_size=500K
    innodb_thread_concurrency=2
    [mysqldump]
    quick
    quote-names
    max_allowed_packet	= 16M
    
    [mysql]
    #no-auto-rehash	# faster start of mysql but no tab completition
    
    [isamchk]
    key_buffer		= 16M
    #
    #
    # * IMPORTANT: Additional settings that can override those from this file!
    #   The files must end with '.cnf', otherwise they'll be ignored.
    #
    !includedir /etc/mysql/conf.d/
    bir yerde bir bottleneck olusuyor ama nerede anlamadim.
    Mysql versiyon :mysql Ver 14.14 Distrib 5.5.46
  • 26-11-2015, 23:42:53
    #2
    en önemli kısmını paylaşmamışsınız. general recommendations bölümünde nereye ne yapmanız gerektiği yazar. Ama ciddi bir sorun görmüyorum, php kodlarınız kasılmaya neden oluyor olabilir. sistemi izlemek gerekiyor.
  • 27-11-2015, 00:34:53
    #3
    @GlobalHosting; hocamızı davet edelim konuya. Yardımcı olacaktır
  • 27-11-2015, 12:01:15
    #4
    reddoc adlı üyeden alıntı: mesajı görüntüle
    en önemli kısmını paylaşmamışsınız. general recommendations bölümünde nereye ne yapmanız gerektiği yazar. Ama ciddi bir sorun görmüyorum, php kodlarınız kasılmaya neden oluyor olabilir. sistemi izlemek gerekiyor.
    PiEycPi adlı üyeden alıntı: mesajı görüntüle
    @GlobalHosting; hocamızı davet edelim konuya. Yardımcı olacaktır
    @reddoc
    Dün MySQL 'in kendi dökümantasyonundan birseyler okuyup my.cnf 'i biraz daha düzenledim. Simdi cikan önerilen kismi ise;
    General recommendations:
        Run OPTIMIZE TABLE to defragment tables for better performance
        MySQL started within last 24 hours - recommendations may be inaccurate
        When making adjustments, make tmp_table_size/max_heap_table_size equal
        Reduce your SELECT DISTINCT queries which have no LIMIT clause
    Variables to adjust:
        tmp_table_size (> 16M)
        max_heap_table_size (> 16M)
    .
    tablolari optimize etmeye calistim ama ne bir hata var dedi ne de bir tabloyu optimize edebildi.
    Php ile sunucuyu yordugumu düsünmüyorum ne yalan söyleyeyim. Tek sakincali kisim; 30 saniye de bir bildirim takip eden bir AJAX fonksiyonu var. Socket ile belki yük biraz azalir ama pleskten kaynak kullanimina baktigimda orada da bir sikinti mevcut degil.


    @PiEycPi siz yerime etmis olmussunuz zaten. Tesekkür ederim
  • 27-11-2015, 21:49:59
    #5
    Sunucu yük altında değilken aldığınız sonuçlar sizi yanıltacaktır. 100 kullanıcıya ulaşıldığında sistem mysql'de mi php'de mi yoksa apache'de mi patlıyor. Yoksa ağ çıkışınız mı sizi engelliyor. Belki de diskiniz sizi yarı yolda bırakıyor. Cache durumunuz nedir? Burada çok soru, çok sorun kaynağı var. Ayrıntılı incelemek gerekiyor ki sonucu net alalım.

    mysqltuner gibi uygulamalardan kayda değer sonuç alabilmek için sistemin stres altına girmesi, bir süre çalışması gerekir.