Добро пожаловать! Это — архивная версия форумов на «Хакер.Ru». Она работает в режиме read-only.
 

php'ные куралесены...

Пользователи, просматривающие топик: none

Зашли как: Guest
Все форумы >> [*nix/Linux] >> php'ные куралесены...
Имя
Сообщение << Старые топики   Новые топики >>
php'ные куралесены... - 2009-08-30 23:15:02.163333   
gloomen1

Сообщений: 89
Оценки: 0
Присоединился: 2009-06-27 12:58:33.100000
Всем здравия и благополучия!
Проблемы с PHP, при заходе на сайт, в логах появляется:

ee /var/log/php-fpm.log
Aug 30 23:11:22.960921 [WARNING] fpm_request_check_timed_out(), line 146: child 596, script '/usr/local/www/web1/index.php' (pool default) executing too slow (5.069391 sec), logg Aug 30 23:11:22.961224 [NOTICE] fpm_got_signal(), line 48: received SIGCHLD Aug 30 23:11:22.961607 [NOTICE] fpm_children_bury(), line 194: child 596 stopped for tracing Aug 30 23:11:22.961689 [NOTICE] fpm_php_trace(), line 139: about to trace 596 Aug 30 23:11:22.962430 [ERROR] fpm_trace_get_long(), line 69: ptrace(PT_IO) failed: Bad address (14) Aug 30 23:11:22.980848 [NOTICE] fpm_php_trace(), line 167: finished trace of 596
ee /usr/local/etc/nginx/nginx.conf
user www; worker_processes 3; pid /var/run/nginx.pid; worker_rlimit_nofile 1000; events { worker_connections 2000; } http { include mime.types; default_type application/octet-stream; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; server_names_hash_max_size 2048; server_names_hash_bucket_size 128; sendfile on; gzip on; gzip_min_length 2048; gzip_types text/css text/js text/xml; client_max_body_size 10m; large_client_header_buffers 4 8k; log_format main '$remote_addr - $remote_user [$time_local] ' '"$request"' '"$http_referer" "$http_user_agent" "$gzip_ratio"'; server { listen 80; server_name mysite.com; access_log /var/log/nginx.access_log main; charset windows-1251; client_max_body_size 25m; location / { root /usr/local/www/web1; index index.html index.php; } location ~* \.php$ { fastcgi_connect_timeout 60; fastcgi_send_timeout 180; fastcgi_read_timeout 180; fastcgi_buffer_size 1024k; fastcgi_buffers 4 1024k; fastcgi_busy_buffers_size 1024k; fastcgi_temp_file_write_size 1024k; fastcgi_temp_path /tmp; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/local/www/web1$fastcgi_script_name; include fastcgi_params; } } }
ee /usr/local/etc/php-fpm.conf
&lt;?xml version="1.0" ?&gt; &lt;configuration&gt; All relative paths in this config are relative to php's install prefix &lt;section name="global_options"&gt; Pid file &lt;value name="pid_file"&gt;/var/run/php-fpm.pid&lt;/value&gt; Error log file &lt;value name="error_log"&gt;/var/log/php-fpm.log&lt;/value&gt; Log level &lt;value name="log_level"&gt;notice&lt;/value&gt; When this amount of php processes exited with SIGSEGV or SIGBUS ... &lt;value name="emergency_restart_threshold"&gt;10&lt;/value&gt; ... in a less than this interval of time, a graceful restart will be initiated. Useful to work around accidental curruptions in accelerator's shared memory. &lt;value name="emergency_restart_interval"&gt;1m&lt;/value&gt; Time limit on waiting child's reaction on signals from master &lt;value name="process_control_timeout"&gt;5s&lt;/value&gt; Set to 'no' to debug fpm &lt;value name="daemonize"&gt;yes&lt;/value&gt; &lt;/section&gt; &lt;workers&gt; &lt;section name="pool"&gt; Name of pool. Used in logs and stats. &lt;value name="name"&gt;default&lt;/value&gt; Address to accept fastcgi requests on. Valid syntax is 'ip.ad.re.ss:port' or just 'port' or '/path/to/unix/socket' &lt;value name="listen_address"&gt;127.0.0.1:9000&lt;/value&gt; &lt;value name="listen_options"&gt; Set listen(2) backlog &lt;value name="backlog"&gt;-1&lt;/value&gt; Set permissions for unix socket, if one used. In Linux read/write permissions must be set in order to allow connections from web server. Many BSD-derrived systems allow connections regardless of permissions. &lt;value name="owner"&gt;&lt;/value&gt; &lt;value name="group"&gt;&lt;/value&gt; &lt;value name="mode"&gt;0666&lt;/value&gt; &lt;/value&gt; Additional php.ini defines, specific to this pool of workers. &lt;value name="php_defines"&gt; &lt;!-- &lt;value name="sendmail_path"&gt;/usr/sbin/sendmail -t -i&lt;/value&gt; --&gt; &lt;!-- &lt;value name="display_errors"&gt;0&lt;/value&gt; --&gt; &lt;/value&gt; Unix user of processes &lt;value name="user"&gt;www&lt;/value&gt; Unix group of processes &lt;value name="group"&gt;www&lt;/value&gt; Process manager settings &lt;value name="pm"&gt; Sets style of controling worker process count. Valid values are 'static' and 'apache-like' &lt;value name="style"&gt;static&lt;/value&gt; Sets the limit on the number of simultaneous requests that will be served. Equivalent to Apache MaxClients directive. Equivalent to PHP_FCGI_CHILDREN environment in original php.fcgi Used with any pm_style. &lt;value name="max_children"&gt;5&lt;/value&gt; Settings group for 'apache-like' pm style &lt;value name="apache_like"&gt; Sets the number of server processes created on startup. Used only when 'apache-like' pm_style is selected &lt;value name="StartServers"&gt;20&lt;/value&gt; Sets the desired minimum number of idle server processes. Used only when 'apache-like' pm_style is selected &lt;value name="MinSpareServers"&gt;5&lt;/value&gt; Sets the desired maximum number of idle server processes. Used only when 'apache-like' pm_style is selected &lt;value name="MaxSpareServers"&gt;35&lt;/value&gt; &lt;/value&gt; &lt;/value&gt; The timeout (in seconds) for serving a single request after which the worker process will be terminated Should be used when 'max_execution_time' ini option does not stop script execution for some reason '0s' means 'off' &lt;value name="request_terminate_timeout"&gt;0s&lt;/value&gt; The timeout (in seconds) for serving of single request after which a php backtrace will be dumped to slow.log file '0s' means 'off' &lt;value name="request_slowlog_timeout"&gt;5s&lt;/value&gt; The log file for slow requests &lt;value name="slowlog"&gt;/var/log/php-slow.log&lt;/value&gt; Set open file desc rlimit &lt;value name="rlimit_files"&gt;1024&lt;/value&gt; Set max core size rlimit &lt;value name="rlimit_core"&gt;0&lt;/value&gt; Chroot to this directory at the start, absolute path &lt;value name="chroot"&gt;&lt;/value&gt; Chdir to this directory at the start, absolute path &lt;value name="chdir"&gt;&lt;/value&gt; Redirect workers' stdout and stderr into main error log. If not set, they will be redirected to /dev/null, according to FastCGI specs &lt;value name="catch_workers_output"&gt;yes&lt;/value&gt; How much requests each process should execute before respawn. Useful to work around memory leaks in 3rd party libraries. For endless request processing please specify 0 Equivalent to PHP_FCGI_MAX_REQUESTS &lt;value name="max_requests"&gt;1500&lt;/value&gt; Comma separated list of ipv4 addresses of FastCGI clients that allowed to connect. Equivalent to FCGI_WEB_SERVER_ADDRS environment in original php.fcgi (5.2.2+) Makes sense only with AF_INET listening socket. &lt;value name="allowed_clients"&gt;127.0.0.1&lt;/value&gt; Pass environment variables like LD_LIBRARY_PATH All $VARIABLEs are taken from current environment &lt;value name="environment"&gt; &lt;value name="HOSTNAME"&gt;$HOSTNAME&lt;/value&gt; &lt;value name="PATH"&gt;/usr/local/bin:/usr/bin:/bin&lt;/value&gt; &lt;value name="TMP"&gt;/tmp&lt;/value&gt; &lt;value name="TMPDIR"&gt;/tmp&lt;/value&gt; &lt;value name="TEMP"&gt;/tmp&lt;/value&gt; &lt;value name="OSTYPE"&gt;$OSTYPE&lt;/value&gt; &lt;value name="MACHTYPE"&gt;$MACHTYPE&lt;/value&gt; &lt;value name="MALLOC_CHECK_"&gt;2&lt;/value&gt; &lt;/value&gt; &lt;/section&gt; &lt;/workers&gt; &lt;/configuration&gt;

ee /usr/local/etc/php.ini
[PHP] engine = On zend.ze1_compatibility_mode = Off short_open_tag = On asp_tags = Off precision = 14 y2k_compliance = On output_buffering = 4096 zlib.output_compression = Off implicit_flush = Off unserialize_callback_func= serialize_precision = 100 allow_call_time_pass_reference = Off safe_mode = Off safe_mode_gid = Off safe_mode_include_dir = safe_mode_exec_dir = safe_mode_allowed_env_vars = PHP_ safe_mode_protected_env_vars = LD_LIBRARY_PATH disable_functions = disable_classes = expose_php = On max_execution_time = 60 max_input_time = 60 memory_limit = 48M ; увеличиваем лимит по памяти для "тяжелых" скриптов error_reporting = E_ALL & ~E_NOTICE display_errors = Off display_startup_errors = Off log_errors = On log_errors_max_len = 1024 ;размер лога ignore_repeated_errors = On ignore_repeated_source = On report_memleaks = On track_errors = On variables_order = "EGPCS" register_globals = off register_long_arrays = Off register_argc_argv = Off auto_globals_jit = On post_max_size = 12M magic_quotes_gpc = Off magic_quotes_runtime = Off magic_quotes_sybase = Off auto_prepend_file = auto_append_file = default_mimetype = "text/html" doc_root = user_dir = enable_dl = On file_uploads = On upload_max_filesize = 8M allow_url_fopen = On allow_url_include = Off default_socket_timeout = 60 [Syslog] define_syslog_variables = Off [mail function] SMTP = localhost smtp_port = 25 [SQL] sql.safe_mode = Off [ODBC] odbc.allow_persistent = On odbc.check_persistent = On odbc.max_persistent = -1 odbc.max_links = -1 odbc.defaultlrl = 4096 odbc.defaultbinmode = 1 [MySQL] mysql.allow_persistent = On mysql.max_persistent = -1 mysql.max_links = -1 mysql.default_port = mysql.default_socket = mysql.default_host = mysql.default_user = mysql.default_password = mysql.connect_timeout = 60 mysql.trace_mode = Off [MySQLi] mysqli.max_links = -1 mysqli.default_port = 3306 mysqli.default_socket = mysqli.default_host = mysqli.default_user = mysqli.default_pw = mysqli.reconnect = Off [mSQL] msql.allow_persistent = On msql.max_persistent = -1 msql.max_links = -1 [PostgresSQL] pgsql.allow_persistent = On pgsql.auto_reset_persistent = Off pgsql.max_persistent = -1 pgsql.max_links = -1 pgsql.ignore_notice = 0 pgsql.log_notice = 0 [Sybase] sybase.allow_persistent = On sybase.max_persistent = -1 sybase.max_links = -1 sybase.min_error_severity = 10 sybase.min_message_severity = 10 sybase.compatability_mode = Off [Sybase-CT] sybct.allow_persistent = On sybct.max_persistent = -1 sybct.max_links = -1 sybct.min_server_severity = 10 sybct.min_client_severity = 10 [bcmath] bcmath.scale = 0 [Informix] ifx.default_host = ifx.default_user = ifx.default_password = ifx.allow_persistent = On ifx.max_persistent = -1 ifx.max_links = -1 ifx.textasvarchar = 0 ifx.byteasvarchar = 0 ifx.charasvarchar = 0 ifx.blobinfile = 0 ifx.nullformat = 0 [Session] session.save_handler = files session.use_cookies = 1 session.name = PHPSESSID session.auto_start = 0 session.cookie_lifetime = 0 session.cookie_path = / session.cookie_domain = session.cookie_httponly = session.serialize_handler = php session.gc_probability = 1 session.gc_divisor = 1000 session.gc_maxlifetime = 256000 session.bug_compat_42 = 0 session.bug_compat_warn = 1 session.referer_check = session.entropy_length = 0 session.entropy_file = session.cache_limiter = nocache session.cache_expire = 18000 session.use_trans_sid = 0 session.hash_function = 0 session.hash_bits_per_character = 5 url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry" [Tidy] tidy.clean_output = Off [soap] soap.wsdl_cache_enabled=1 soap.wsdl_cache_dir="/tmp" soap.wsdl_cache_ttl=86400 [Zend] ; eAccelerator zend_extension="/usr/local/lib/php/20060613/eaccelerator.so" eaccelerator.enable="1" eaccelerator.shm_size="64" eaccelerator.cache_dir="/tmp/eaccelerator" eaccelerator.optimizer="1" eaccelerator.check_mtime="1" eaccelerator.debug="0" eaccelerator.filter="" eaccelerator.shm_max="0" eaccelerator.shm_ttl="3600" eaccelerator.shm_prune_period="0" eaccelerator.shm_only="0" eaccelerator.compress="1" eaccelerator.compress_level="9"
root# uname -a FreeBSD 6.4-RELEASE root@dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 root# php -v PHP 5.2.10 with Suhosin-Patch 0.9.7 (cli) (built: Aug 26 2009 20:59:41) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies with eAccelerator v0.9.5.3, Copyright (c) 2004-2006 eAccelerator, by eAccelerator root# php-cgi -v PHP 5.2.10 with Suhosin-Patch 0.9.7 (cgi-fcgi) (built: Aug 26 2009 20:59:11) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies with eAccelerator v0.9.5.3, Copyright (c) 2004-2006 eAccelerator, by eAccelerator
Post #: 1
RE: php'ные куралесены... - 2009-08-30 23:38:59.880000   
rgo

Сообщений: 7170
Оценки: 281
Присоединился: 2004-09-25 05:14:25
quote:

Aug 30 23:11:22.960921 [WARNING] fpm_request_check_timed_out(), line 146: child 596, sсriрt '/usr/local/www/web1/index.php' (pool default) executing too slow (5.069391 sec), logg

Читаем внимательно. дочерний процесс (а именно скрипт /usr/local/www/web1/index.php) выполняется слишком долго, уже больше пяти секунд. За это его и прибивают.
Post #: 2
RE: php'ные куралесены... - 2009-08-31 10:37:42.670000   
gloomen1

Сообщений: 89
Оценки: 0
Присоединился: 2009-06-27 12:58:33.100000
да..да…я отомже, у меня сайт открывается ~30 секунд, никак немогу понять в чём дело…
а, вот на этомже сервере phpmyadmin, работает очень быстро!
Post #: 3
RE: php'ные куралесены... - 2009-08-31 19:17:24.130000   
gloomen1

Сообщений: 89
Оценки: 0
Присоединился: 2009-06-27 12:58:33.100000
Народ не проходите мимо….в чём же может быть дело?
Post #: 4
RE: php'ные куралесены... - 2009-08-31 20:19:25.760000   
oRb

Сообщений: 4044
Оценки: 597
Присоединился: 2007-03-28 18:45:06.630000
Игра угадай содержимое файла по его абсолютному пути?
Как можно сказать, почему скрипт долго работает, не видя его кода?
Post #: 5
RE: php'ные куралесены... - 2009-09-01 11:32:35.140000   
gloomen1

Сообщений: 89
Оценки: 0
Присоединился: 2009-06-27 12:58:33.100000
ee /usr/local/www/web1/index.php

&lt;?php /* This file is part of TorrentPier TorrentPier is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. TorrentPier is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. A copy of the GPL 2.0 should have been included with the program. If not, see http://www.gnu.org/licenses/ Official SVN repository and contact information can be found at http://code.google.com/p/torrentpier/ */ define('IN_PHPBB', true); define('BB_SCRIPT', 'index'); define('BB_ROOT', './'); $phpEx = substr(strrchr(__FILE__, '.'), 1); require(BB_ROOT ."common.$phpEx"); $page_cfg['load_tpl_vars'] = array( 'post_icons', ); $show_last_topic = true; $last_topic_max_len = 28; $show_online_users = true; $show_subforums = true; $datastore-&gt;enqueue(array( 'stats', 'moderators', )); if ($bb_cfg['show_latest_news']) { $datastore-&gt;enqueue('latest_news'); } // Init userdata $user-&gt;session_start(); // Init main vars $viewcat = isset($_GET['c']) ? (int) $_GET['c'] : 0; $lastvisit = (IS_GUEST) ? TIMENOW : $userdata['user_lastvisit']; // Caching output $req_page = 'index_page'; $req_page .= ($viewcat) ? "_c{$viewcat}" : ''; define('REQUESTED_PAGE', $req_page); caching_output(IS_GUEST, 'send', REQUESTED_PAGE .'_guest'); // Topics read tracks $tracking_topics = get_tracks('topic'); $tracking_forums = get_tracks('forum'); // Statistics $stats = $datastore-&gt;get('stats'); // Forums data $forums = $datastore-&gt;get('cat_forums'); $cat_title_html = $forums['cat_title_html']; $forum_name_html = $forums['forum_name_html']; $anon = ANONYMOUS; $excluded_forums_csv = $user-&gt;get_excluded_forums(AUTH_VIEW); $only_new = $user-&gt;opt_js['only_new']; // Validate requested category id if ($viewcat AND !$viewcat =& $forums['c'][$viewcat]['cat_id']) { redirect("index.$phpEx"); } // Forums $forums_join_sql = 'f.cat_id = c.cat_id'; $forums_join_sql .= ($viewcat) ? " AND f.cat_id = $viewcat " : ''; $forums_join_sql .= ($excluded_forums_csv) ? " AND f.forum_id NOT IN($excluded_forums_csv) AND f.forum_parent NOT IN($excluded_forums_csv) " : ''; // Posts $posts_join_sql = "p.post_id = f.forum_last_post_id"; $posts_join_sql .= ($only_new == ONLY_NEW_POSTS) ? " AND p.post_time &gt; $lastvisit " : ''; $join_p_type = ($only_new == ONLY_NEW_POSTS) ? 'INNER JOIN' : 'LEFT JOIN'; // Topics $topics_join_sql = "t.topic_last_post_id = p.post_id"; $topics_join_sql .= ($only_new == ONLY_NEW_TOPICS) ? " AND t.topic_time &gt; $lastvisit " : ''; $join_t_type = ($only_new == ONLY_NEW_TOPICS) ? 'INNER JOIN' : 'LEFT JOIN'; $sql = " SELECT SQL_CACHE f.cat_id, f.forum_id, f.forum_status, f.forum_parent, f.show_on_index, p.post_id AS last_post_id, p.post_time AS last_post_time, t.topic_id AS last_topic_id, t.topic_title AS last_topic_title, u.user_id AS last_post_user_id, IF(p.poster_id = $anon, p.post_username, u.username) AS last_post_username FROM ". CATEGORIES_TABLE ." c INNER JOIN ". FORUMS_TABLE ." f ON($forums_join_sql) $join_p_type ". POSTS_TABLE ." p ON($posts_join_sql) $join_t_type ". TOPICS_TABLE ." t ON($topics_join_sql) LEFT JOIN ". USERS_TABLE ." u ON(u.user_id = p.poster_id) ORDER BY c.cat_order, f.forum_order "; $cat_forums = array(); $replace_in_parent = array( 'last_post_id', 'last_post_time', 'last_post_user_id', 'last_post_username', 'last_topic_title', 'last_topic_id', ); foreach ($db-&gt;fetch_rowset($sql) as $row) { if (!$cat_id = $row['cat_id'] OR !$forum_id = $row['forum_id']) { continue; } if ($parent_id = $row['forum_parent']) { if (!$parent =& $cat_forums[$cat_id]['f'][$parent_id]) { $parent = $forums['f'][$parent_id]; $parent['last_post_time'] = 0; } if ($row['last_post_time'] &gt; $parent['last_post_time']) { foreach ($replace_in_parent as $key) { $parent[$key] = $row[$key]; } } if ($show_subforums && $row['show_on_index']) { $parent['last_sf_id'] = $forum_id; } else { continue; } } else { $f =& $forums['f'][$forum_id]; $row['forum_desc'] = $f['forum_desc']; $row['forum_posts'] = $f['forum_posts']; $row['forum_topics'] = $f['forum_topics']; } $cat_forums[$cat_id]['f'][$forum_id] = $row; } unset($forums); $datastore-&gt;rm('cat_forums'); // Obtain list of moderators $moderators = array(); $mod = $datastore-&gt;get('moderators'); foreach ($mod['mod_users'] as $forum_id =&gt; $user_ids) { foreach ($user_ids as $user_id) { $moderators[$forum_id][] = '&lt;a href="'. (PROFILE_URL . $user_id) .'"&gt;'. $mod['name_users'][$user_id] .'&lt;/a&gt;'; } } foreach ($mod['mod_groups'] as $forum_id =&gt; $group_ids) { foreach ($group_ids as $group_id) { $moderators[$forum_id][] = '&lt;a href="'. (GROUP_URL . $group_id) .'"&gt;'. $mod['name_groups'][$group_id] .'&lt;/a&gt;'; } } unset($mod); $datastore-&gt;rm('moderators'); if (!$forums_count = count($cat_forums) AND $viewcat) { redirect("index.$phpEx"); } $template-&gt;assign_vars(array( 'SHOW_FORUMS' =&gt; $forums_count, 'PAGE_TITLE' =&gt; $lang['Index'], 'NO_FORUMS_MSG' =&gt; ($only_new) ? $lang['NO_NEW_POSTS'] : $lang['NO_FORUMS'], 'TOTAL_TOPICS' =&gt; sprintf($lang['Posted_topics_total'], $stats['topiccount']), 'TOTAL_POSTS' =&gt; sprintf($lang['Posted_articles_total'], $stats['postcount']), 'TOTAL_USERS' =&gt; sprintf($lang['Registered_users_total'], $stats['usercount']), 'NEWEST_USER' =&gt; sprintf($lang['Newest_user'], '&lt;a href="'. PROFILE_URL . $stats['newestuser']['user_id'] .'"&gt;', $stats['newestuser']['username'], '&lt;/a&gt;'), // Tracker stats 'TORRENTS_STAT' =&gt; sprintf($lang['Torrents_stat'], $stats['torrentcount'], humn_size($stats['size'])), 'PEERS_STAT' =&gt; sprintf($lang['Peers_stat'], $stats['peers'], $stats['seeders'], $stats['leechers']), 'SPEED_STAT' =&gt; sprintf($lang['Speed_stat'], humn_size($stats['speed']) .'/s'), 'FORUM_IMG' =&gt; $images['forum'], 'FORUM_NEW_IMG' =&gt; $images['forum_new'], 'FORUM_LOCKED_IMG' =&gt; $images['forum_locked'], 'SHOW_ONLY_NEW_MENU' =&gt; true, 'ONLY_NEW_POSTS_ON' =&gt; ($only_new == ONLY_NEW_POSTS), 'ONLY_NEW_TOPICS_ON' =&gt; ($only_new == ONLY_NEW_TOPICS), 'U_SEARCH_NEW' =&gt; "search.$phpEx?new=1", 'U_SEARCH_SELF_BY_MY' =&gt; "search.$phpEx?uid={$userdata['user_id']}&amp;o=1", 'U_SEARCH_LATEST' =&gt; "search.$phpEx?search_id=latest", 'U_SEARCH_UNANSWERED' =&gt; "search.$phpEx?search_id=unanswered", 'SHOW_LAST_TOPIC' =&gt; $show_last_topic, )); // Build index page foreach ($cat_forums as $cid =&gt; $c) { $template-&gt;assign_block_vars('c', array( 'CAT_ID' =&gt; $cid, 'CAT_TITLE' =&gt; $cat_title_html[$cid], 'U_VIEWCAT' =&gt; "index.$phpEx?c=$cid", )); foreach ($c['f'] as $fid =&gt; $f) { if (!$fname_html =& $forum_name_html[$fid]) { continue; } $is_sf = $f['forum_parent']; $new = is_unread($f['last_post_time'], $f['last_topic_id'], $f['forum_id']) ? '_new' : ''; $folder_image = ($is_sf) ? $images["icon_minipost{$new}"] : $images["forum{$new}"]; if ($f['forum_status'] == FORUM_LOCKED) { $folder_image = ($is_sf) ? $images['icon_minipost'] : $images['forum_locked']; } if ($is_sf) { $template-&gt;assign_block_vars('c.f.sf', array( 'SF_ID' =&gt; $fid, 'SF_NAME' =&gt; $fname_html, 'SF_NEW' =&gt; $new ? ' new' : '', )); continue; } $template-&gt;assign_block_vars('c.f', array( 'FORUM_FOLDER_IMG' =&gt; $folder_image, 'FORUM_ID' =&gt; $fid, 'FORUM_NAME' =&gt; $fname_html, 'FORUM_DESC' =&gt; $f['forum_desc'], 'POSTS' =&gt; commify($f['forum_posts']), 'TOPICS' =&gt; commify($f['forum_topics']), 'LAST_SF_ID' =&gt; isset($f['last_sf_id']) ? $f['last_sf_id'] : null, 'MODERATORS' =&gt; isset($moderators[$fid]) ? join(', ', $moderators[$fid]) : '', 'FORUM_FOLDER_ALT' =&gt; ($new) ? 'new' : 'old', )); if ($f['last_post_id']) { $template-&gt;assign_block_vars('c.f.last', array( 'LAST_TOPIC_ID' =&gt; $f['last_topic_id'], 'LAST_TOPIC_TIP' =&gt; $f['last_topic_title'], 'LAST_TOPIC_TITLE' =&gt; wbr(str_short($f['last_topic_title'], $last_topic_max_len)), 'LAST_POST_TIME' =&gt; create_date($bb_cfg['last_post_date_format'], $f['last_post_time']), 'LAST_POST_USER_ID' =&gt; ($f['last_post_user_id'] != ANONYMOUS) ? $f['last_post_user_id'] : false, 'LAST_POST_USER_NAME' =&gt; ($f['last_post_username']) ? str_short($f['last_post_username'], 15) : $lang['Guest'], )); } } } // Set tpl vars for bt_userdata if ($bb_cfg['bt_show_dl_stat_on_index'] && !IS_GUEST) { show_bt_userdata($userdata['user_id']); } // Latest news if ($bb_cfg['show_latest_news']) { $latest_news = $datastore-&gt;get('latest_news'); $template-&gt;assign_vars(array( 'SHOW_LATEST_NEWS' =&gt; true, )); foreach ($latest_news as $news) { $template-&gt;assign_block_vars('news', array( 'NEWS_TOPIC_ID' =&gt; $news['topic_id'], 'NEWS_TITLE' =&gt; $news['topic_title'], 'NEWS_TIME' =&gt; create_date('d-M', $news['topic_time']), 'NEWS_IS_NEW' =&gt; $news['topic_time'] &gt; $lastvisit, )); } } // Allow cron if (IS_ADMIN || IS_MOD) { if (@file_exists(CRON_RUNNING)) { if (@file_exists(CRON_ALLOWED)) { unlink (CRON_ALLOWED); } rename(CRON_RUNNING, CRON_ALLOWED); } } // Display page define('SHOW_ONLINE', $show_online_users); print_page('index.tpl');
Post #: 6
RE: php'ные куралесены... - 2009-09-01 11:44:31.770000   
oRb

Сообщений: 4044
Оценки: 597
Присоединился: 2007-03-28 18:45:06.630000
Есть только 1 предположение: у вас слишком большая база. Возможно разработчики трекера не расчитывали, что их детище, будет оперировать таким количеством данных.
Post #: 7
RE: php'ные куралесены... - 2009-09-01 15:33:33.953333   
gloomen1

Сообщений: 89
Оценки: 0
Присоединился: 2009-06-27 12:58:33.100000
я снеделю назад настроил сервер, там зарегистрирован только йА, он закрыт для внешнего мира…

Какие ещё будут предложения?
Post #: 8
RE: php'ные куралесены... - 2009-09-01 15:49:57.770000   
gloomen1

Сообщений: 89
Оценки: 0
Присоединился: 2009-06-27 12:58:33.100000
После смены интервала с 5s на 60s
появилось следующее:
Sep 01 16:37:15.760002 [NOTICE] fpm_unix_init_main(), line 284: getrlimit(nofile): max:7207, cur:7207
Sep 01 16:37:15.798769 [NOTICE] fpm_event_init_main(), line 88: libevent: using kqueue
Sep 01 16:37:15.799337 [NOTICE] fpm_init(), line 52: fpm is running, pid 595
Sep 01 16:37:15.908277 [NOTICE] fpm_children_make(), line 352: child 599 (pool default) started
Sep 01 16:37:15.912196 [NOTICE] fpm_children_make(), line 352: child 614 (pool default) started
Sep 01 16:37:15.922960 [NOTICE] fpm_children_make(), line 352: child 615 (pool default) started
Sep 01 16:37:15.926873 [NOTICE] fpm_children_make(), line 352: child 616 (pool default) started
Sep 01 16:37:15.930914 [NOTICE] fpm_children_make(), line 352: child 617 (pool default) started
Sep 01 16:37:15.931565 [NOTICE] fpm_event_loop(), line 107: libevent: entering main loop
Post #: 9
RE: php'ные куралесены... - 2009-09-01 16:45:56.890000   
gloomen1

Сообщений: 89
Оценки: 0
Присоединился: 2009-06-27 12:58:33.100000
GZIP OFF
[ Execution time: 16,326 sec | MySQL: 26 queries | GZIP OFF | Mem: 459,51 KB / 2,97 MB / 2,45 MB | Load: 0 0 0 ]

GZIP ON
[ Execution time: 28,326 sec | MySQL: 26 queries | GZIP OFF | Mem: 459,51 KB / 2,97 MB / 2,45 MB | Load: 0 0 0 ]

хм…где ещё сoбака зарыта….
Post #: 10
RE: php'ные куралесены... - 2009-09-01 20:59:06.753333   
gloomen1

Сообщений: 89
Оценки: 0
Присоединился: 2009-06-27 12:58:33.100000
И так, лазутчик найден…..
[ Execution time: 31,804 sec | MySQL: 75 queries | GZIP OFF | Mem: 459,54 KB / 3 MB / 2,49 MB | Load: 1 0,3 0,1 ]
дело в том, что когда кол-во запросов в MySQL ~75 queries, то время загрузки начальной страницы 31,804 sec


ee /etc/my.cnf
# Опции для всех клиентов MySQL [client] # Пароль для подключения к БД #password = your_password # Порт на котором висит MySQL port = 3306 # Сокет MySQL socket = /tmp/mysql.sock # Опции MySQL-сервера [mysqld] log-slow-queries = /var/log/mysql-slow.log #т.е. лог для запросов &gt; 1 минуты..................у меня пусто! long_query_time = 1 # Порт port = 3306 # Адрес, который будем слушать (если вам не нужно подключаться к # MySQL с других машин, то оставьте здесь 127.0.0.1) bind-address = 127.0.0.1 # Где лежит сокет socket = /tmp/mysql.sock # Не использовать средства системных блокировок. skip-locking # #Расчет идет из 1/4 от оперативки,но не больше 1/2 иначе будут #скидыватся на жесткий временные файлы, что повлечет снижение #производительности key_buffer = 256K # Максимальный размер одного пакета max_allowed_packet = 1M table_cache = 4 sort_buffer_size = 64K read_buffer_size = 256K read_rnd_buffer_size = 256K net_buffer_length = 2K thread_stack = 64K skip-networking skip-innodb skip-bdb server-id = 1 #Логи # Файл должен существовать, с соответствующими правами на него: # touch /var/log/mysql.log # chown mysql:wheel /var/log/mysql.log # chmod 640 /var/log/mysql.log log = /var/log/mysql.log [mysqldump] # Если задан этот параметр, то обработчик таблицы при выполнении # удаления не будет объединять индексы - в некоторых случаях это # может ускорить данную операцию quick # Максимальная величина пакета, посылаемого/принимаемого с сервера max_allowed_packet = 16M [mysql] # Отключает автоматическое рехеширование. rehash следует использовать # для получения хеша таблиц и полей. Это обеспечивает более # быстрый старт mysql. no-auto-rehash # Опция, которую рекомендуется раскомментить начинающим :) # Разрешает выполнять только операции UPDATE и DELETE, используя ключи. #safe-updates [isamchk] key_buffer = 8M sort_buffer_size = 8M [myisamchk] key_buffer = 8M sort_buffer_size = 8M [mysqlhotcopy] # Допускать простой длительностью interactive_timeout секунд (вместо # wait_timeout секунд) перед закрытием данного соединения. interactive-timeout
где теперь баг?
Post #: 11
Страниц:  [1]
Все форумы >> [*nix/Linux] >> php'ные куралесены...







Связаться:
Вопросы по сайту / xakep@glc.ru

Предупреждение: использование полученных знаний в противозаконных целях преследуется по закону.