Этот баннер — требование Роскомнадзора для исполнения 152 ФЗ.
«На сайте осуществляется обработка файлов cookie, необходимых для работы сайта, а также для анализа использования сайта и улучшения предоставляемых сервисов с использованием метрической программы Яндекс.Метрика. Продолжая использовать сайт, вы даёте согласие с использованием данных технологий».
Политика конфиденциальности
|
|
|
Расширение ресурсов
|
|||
|---|---|---|---|
|
#18+
Здравствуйте красно глазики! Столкнулся с проблемой, есть скрипт который перебирает бинарное дерево (начиная с самой вершины), ища где есть свободная ветка (то есть под какой ячейкой незанятое одно из двух мест). Когда в дереве становится около 1000 элементов, скрипт работает довольно медленно (0.5 - 1 сек), а таких запросов происходит много, и в результате скрипт выполняется очень долго, при этом процессор и ОЗУ почти не нагружается (о чем говорит htop). Как выделить mysql больше ресурсов? Пытался настроить по этой статьи , но у меня нет большинства параметров о которых там написано, в конфигурационном файле, а если их пишу самостоятельно, то ничего не меняется. Помогите пожалуйста. /etc/mysql/my.cnf # # The MySQL DATABASE server configuration file. # # You can copy this TO one OF: # - "/etc/mysql/my.cnf" TO SET global options, # - "~/.my.cnf" TO SET user-specific options. # # One can USE ALL long options that the program supports. # 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 [mysqld] # # * Basic Settings # 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. bind-address = 127.0.0.1 # # * Fine Tuning # key_buffer = 16M max_allowed_packet = 16M thread_stack = 192K thread_cache_size = 16 # This replaces the startup script AND checks MyISAM TABLES IF needed # the FIRST TIME they are touched myisam-recover = BACKUP #max_connections = 100 #table_cache = 64 #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 logging goes TO syslog due TO /etc/mysql/conf.d/mysqld_safe_syslog.cnf. # # 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 [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/ ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 22.04.2017, 17:21 |
|
||
|
Расширение ресурсов
|
|||
|---|---|---|---|
|
#18+
TelesКак выделить mysql больше ресурсов?Сначала надо оптимизировать алгоритмы. Затем нужно разобраться каких именно ресурсов не хватает. И только после этого надо искать пути их расширения. И первые две вещи возможны только видя код и зная детали задачи. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 22.04.2017, 19:41 |
|
||
|
|

start [/forum/topic.php?fid=47&msg=39442702&tid=1830735]: |
0ms |
get settings: |
8ms |
get forum list: |
11ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
120ms |
get topic data: |
11ms |
get forum data: |
2ms |
get page messages: |
39ms |
get tp. blocked users: |
1ms |
| others: | 43ms |
| total: | 241ms |

| 0 / 0 |
