Laravel 网站在 15-30 次刷新后冻结。

huangapple go评论113阅读模式
英文:

laravel website freeze after 15-30 refreshes

问题

Here is the translated content:

我有一个使用Laravel制作的网站,它不太庞大,使用了一个mysql数据库。

服务器信息:

微型服务器(SBC)
CPU:Intel® Celeron® N5105 4核4线程
内存:LPDDR4 8GB
存储:500GB NVMe

操作系统:Ubuntu 22.04.2 LTS
Web服务器:Apache 2.4.52
PHP版本:8.1

当我使用网站时,如果操作较慢,服务器的第一个响应大约需要200-300毫秒。但是当我快速刷新页面20-30次时,页面会冻结,下一次需要等待5秒钟才能收到服务器的第一个响应。有时在刷新10次后,有时甚至在30次后会发生,这不是一个固定的值。但一旦发生这种情况,其他用户在此时无法加载页面,他们必须等待5秒或更长时间。大约20-30秒后,网站会再次运行快速。

示例良好的结果:
Laravel 网站在 15-30 次刷新后冻结。

20-30次刷新后:
Laravel 网站在 15-30 次刷新后冻结。

无论是通过域名还是通过IP请求,都不会有影响。这是在网站冻结期间快速刷新时的服务器统计信息:
Laravel 网站在 15-30 次刷新后冻结。

我尝试过:

  • 将Apache2更改为使用php-fpm(https://www.digitalocean.com/community/tutorials/how-to-configure-apache-http-with-mpm-event-and-php-fpm-on-ubuntu-18-04)
  • 重新安装整个Ubuntu并使用Nginx进行配置

不幸的是,问题仍然存在。我在想问题是出在服务器本身还是配置上。在我设置了Google云平台上最小可能的VM - 这是e2-micro(0.25-2 vCPU 1GB MEM) - 安装我的网站后,问题不再出现:O 我可以刷新50次甚至100次。有人能告诉我为什么我的服务器上效果这么差吗?这至少比Google云平台上的性能好4倍。

这是“SHOW VARIABLES;”的输出。

英文:

I have a website which is made in Laravel. it is not too extensive, it uses a mysql database

machine:

microserver (SBC)
CPU: Intel® Celeron® N5105 4c/4t
MEM: LPDDR4 8GB
Storage: 500GB NVMe

System: Ubuntu 22.04.2 LTS
Web: Apache 2.4.52
PHP: 8.1

when I am using the site relatively slowly, the first server response is after about 200-300ms.
but when i refresh the page 20-30 times fast. the page freezes and you have to wait 5 seconds for the first response from the server next time. sometimes the page slows down after 10 and sometimes even after 30 refreshes it is not a constant value. but once this happens, no other user can load the page at that time and they have to wait 5 or more seconds. after about 20-30 seconds, the website works fast again

Example good result:
Laravel 网站在 15-30 次刷新后冻结。

after 20-30 refreshes:
Laravel 网站在 15-30 次刷新后冻结。

it doesn't matter if it performs a request via a domain or to a local server via ip. this is server stats during rapid refreshing while website is frozen:
Laravel 网站在 15-30 次刷新后冻结。

i tried:
changing apache2 to use php-fpm (https://www.digitalocean.com/community/tutorials/how-to-configure-apache-http-with-mpm-event-and-php-fpm-on-ubuntu-18-04)
reinstalled whole ubuntu and configured with nginx

unfortunately the problem still exists I'm wondering if the problem is with the server itself or with the configuration. it seems to me that the server is quite strong for these needs and should easily withstand this load - it's like 20-30 people browsing my site at the same time.

I also set up the smallest possible VM on GCP - this is e2-micro (0.25-2 vCPU 1GB MEM) - installed my website there THE PROBLEM DOESN'T OCCUR :O I can refresh it 50 or 100 times. Can someone tell me why on my server this is working so badly. it's at least 4 times better than the one on gcp

SHOW VARIABLES;

  1. activate_all_roles_on_login OFF
  2. admin_address
  3. admin_port *****
  4. admin_ssl_ca
  5. admin_ssl_capath
  6. admin_ssl_cert
  7. admin_ssl_cipher
  8. admin_ssl_crl
  9. admin_ssl_crlpath
  10. admin_ssl_key
  11. admin_tls_ciphersuites
  12. admin_tls_version TLSv1.2,TLSv1.3
  13. authentication_policy *,,
  14. auto_generate_certs ON
  15. auto_increment_increment 1
  16. auto_increment_offset 1
  17. autocommit ON
  18. automatic_sp_privileges ON
  19. avoid_temporal_upgrade OFF
  20. back_log 151
  21. basedir /usr/
  22. big_tables OFF
  23. bind_address 127.0.0.1
  24. binlog_cache_size 32768
  25. binlog_checksum CRC32
  26. binlog_direct_non_transactional_updates OFF
  27. binlog_encryption OFF
  28. binlog_error_action ABORT_SERVER
  29. binlog_expire_logs_auto_purge ON
  30. binlog_expire_logs_seconds 2592000
  31. binlog_format ROW
  32. binlog_group_commit_sync_delay 0
  33. binlog_group_commit_sync_no_delay_count 0
  34. binlog_gtid_simple_recovery ON
  35. binlog_max_flush_queue_time 0
  36. binlog_order_commits ON
  37. binlog_rotate_encryption_master_key_at_startup OFF
  38. binlog_row_event_max_size 8192
  39. binlog_row_image FULL
  40. binlog_row_metadata MINIMAL
  41. binlog_row_value_options
  42. binlog_rows_query_log_events OFF
  43. binlog_stmt_cache_size 32768
  44. binlog_transaction_compression OFF
  45. binlog_transaction_compression_level_zstd 3
  46. binlog_transaction_dependency_history_size 25000
  47. binlog_transaction_dependency_tracking COMMIT_ORDER
  48. block_encryption_mode aes-128-ecb
  49. build_id 03172b8eeae9ab733eff94a4fc191f6acced9b6d
  50. bulk_insert_buffer_size 8388608
  51. caching_sha2_password_auto_generate_rsa_keys ON
  52. caching_sha2_password_digest_rounds 5000
  53. caching_sha2_password_private_key_path private_key.pem
  54. caching_sha2_password_public_key_path public_key.pem
  55. character_set_client utf8mb4
  56. character_set_connection utf8mb4
  57. character_set_database utf8mb4
  58. character_set_filesystem binary
  59. character_set_results utf8mb4
  60. character_set_server utf8mb4
  61. character_set_system utf8mb3
  62. character_sets_dir /usr/share/mysql/charsets/
  63. check_proxy_users OFF
  64. collation_connection utf8mb4_unicode_ci
  65. collation_database utf8mb4_0900_ai_ci
  66. collation_server utf8mb4_0900_ai_ci
  67. completion_type NO_CHAIN
  68. concurrent_insert AUTO
  69. connect_timeout 10
  70. connection_memory_chunk_size 8912
  71. connection_memory_limit 18446744073709551615
  72. core_file OFF
  73. create_admin_listener_thread OFF
  74. cte_max_recursion_depth 1000
  75. datadir /var/lib/mysql/
  76. default_authentication_plugin caching_sha2_password
  77. default_collation_for_utf8mb4 utf8mb4_0900_ai_ci
  78. default_password_lifetime 0
  79. default_storage_engine InnoDB
  80. default_table_encryption OFF
  81. default_tmp_storage_engine InnoDB
  82. default_week_format 0
  83. delay_key_write ON
  84. delayed_insert_limit 100
  85. delayed_insert_timeout 300
  86. delayed_queue_size 1000
  87. disabled_storage_engines
  88. disconnect_on_expired_password ON
  89. div_precision_increment 4
  90. end_markers_in_json OFF
  91. enforce_gtid_consistency OFF
  92. eq_range_index_dive_limit 200
  93. error_count 0
  94. event_scheduler ON
  95. expire_logs_days 0
  96. explain_format TRADITIONAL
  97. explicit_defaults_for_timestamp ON
  98. external_user
  99. flush OFF
  100. flush_time 0
  101. foreign_key_checks ON
  102. ft_boolean_syntax + -><()~*:""&|
  103. ft_max_word_len 84
  104. ft_min_word_len 4
  105. ft_query_expansion_limit 20
  106. ft_stopword_file (built-in)
  107. general_log OFF
  108. general_log_file /var/lib/mysql/lattepanda.log
  109. generated_random_password_length 20
  110. global_connection_memory_limit 18446744073709551615
  111. global_connection_memory_tracking OFF
  112. group_concat_max_len 1024
  113. group_replication_consistency EVENTUAL
  114. gtid_executed
  115. gtid_executed_compression_period 0
  116. gtid_mode OFF
  117. gtid_next AUTOMATIC
  118. gtid_owned
  119. gtid_purged
  120. have_compress YES
  121. have_dynamic_loading YES
  122. have_geometry YES
  123. have_openssl YES
  124. have_profiling YES
  125. have_query_cache NO
  126. have_rtree_keys YES
  127. have_ssl YES
  128. have_statement_timeout YES
  129. have_symlink DISABLED
  130. histogram_generation_max_mem_size 20000000
  131. host_cache_size 279
  132. hostname lattepanda
  133. identity 0
  134. immediate_server_version 999999
  135. information_schema_stats_expiry 86400
  136. init_connect
  137. init_file
  138. init_replica
  139. init_slave
  140. innodb_adaptive_flushing ON
  141. innodb_adaptive_flushing_lwm 10
  142. innodb_adaptive_hash_index ON
  143. innodb_adaptive_hash_index_parts 8
  144. innodb_adaptive_max_sleep_delay 150000
  145. innodb_api_bk_commit_interval 5
  146. innodb_api_disable_rowlock OFF
  147. innodb_api_enable_binlog OFF
  148. innodb_api_enable_mdl OFF
  149. innodb_api_trx_level 0
  150. innodb_autoextend_increment 64
  151. innodb_autoinc_lock_mode 2
  152. innodb_buffer_pool_chunk_size 134217728
  153. innodb_buffer_pool_dump_at_shutdown ON
  154. innodb_buffer_pool_dump_now OFF
  155. innodb_buffer_pool_dump_pct 25
  156. innodb_buffer_pool_filename ib_buffer_pool
  157. innodb_buffer_pool_in_core_file ON
  158. innodb_buffer_pool_instances 1
  159. innodb_buffer_pool_load_abort OFF
  160. innodb_buffer_pool_load_at_startup ON
  161. innodb_buffer_pool_load_now OFF
  162. innodb_buffer_pool_size 134217728
  163. innodb_change_buffer_max_size 25
  164. innodb_change_buffering all
  165. innodb_checksum_algorithm crc32
  166. innodb_cmp_per_index_enabled OFF
  167. innodb_commit_concurrency 0
  168. innodb_compression_failure_threshold_pct 5
  169. innodb_compression_level 6
  170. innodb_compression_pad_pct_max 50
  171. innodb_concurrency_tickets 5000
  172. innodb_data_file_path ibdata1:12M:autoextend
  173. innodb_data_home_dir
  174. innodb_ddl_buffer_size 1048576
  175. innodb_ddl_threads 4
  176. innodb_deadlock_detect ON
  177. innodb_dedicated_server OFF
  178. innodb_default_row_format dynamic
  179. innodb_directories
  180. innodb_disable_sort_file_cache OFF
  181. innodb_doublewrite ON
  182. innodb_doublewrite_batch_size 0
  183. innodb_doublewrite_dir
  184. innodb_doublewrite_files 2
  185. innodb_doublewrite_pages 4
  186. innodb_extend_and_initialize ON
  187. innodb_fast_shutdown 1
  188. innodb_file_per_table ON
  189. innodb_fill_factor 100
  190. innodb_flush_log_at_timeout 1
  191. innodb_flush_log_at_trx_commit 1
  192. innodb_flush_method fsync
  193. innodb_flush_neighbors 0
  194. innodb_flush_sync ON
  195. innodb_flushing_avg_loops 30
  196. innodb_force_load_corrupted OFF
  197. innodb_force_recovery 0
  198. innodb_fsync_threshold 0
  199. innodb_ft_aux_table
  200. innodb_ft_cache_size 8000000
  201. innodb_ft_enable_diag_print OFF
  202. innodb_ft_enable_stopword ON
  203. innodb_ft_max_token_size 84
  204. innodb_ft_min_token_size 3
  205. innodb_ft_num_word_optimize 2000
  206. innodb_ft_result_cache_limit 2000000000
  207. innodb_ft_server_stopword_table
  208. innodb_ft_sort_pll_degree 2
  209. innodb_ft_total_cache_size 640000000
  210. innodb_ft_user_stopword_table
  211. innodb_idle_flush_pct 100
  212. innodb_io_capacity 200
  213. innodb_io_capacity_max 2000
  214. innodb_lock_wait_timeout 50
  215. innodb_log_buffer_size 16777216
  216. innodb_log_checksums ON
  217. innodb_log_compressed_pages ON
  218. innodb_log_file_size 50331648
  219. innodb_log_files_in_group 2
  220. innodb_log_group_home_dir ./
  221. innodb_log_spin_cpu_abs_lwm 80
  222. innodb_log_spin_cpu_pct_hwm 50
  223. innodb_log_wait_for_flush_spin_hwm 400
  224. innodb_log_write_ahead_size 8192
  225. innodb_log_writer_threads ON
  226. innodb_lru_scan_depth 1024
  227. innodb_max_dirty_pages_pct 90.000000
  228. innodb_max_dirty_pages_pct_lwm 10.000000
  229. innodb_max_purge_lag 0
  230. innodb_max_purge_lag_delay 0
  231. innodb_max_undo_log_size 1073741824
  232. innodb_monitor_disable
  233. innodb_monitor_enable
  234. innodb_monitor_reset
  235. innodb_monitor_reset_all
  236. innodb_numa_interleave OFF
  237. innodb_old_blocks_pct 37
  238. innodb_old_blocks_time 1000
  239. innodb_online_alter_log_max_size 134217728
  240. innodb_open_files 4000
  241. innodb_optimize_fulltext_only OFF
  242. innodb_page_cleaners 1
  243. innodb_page_size 16384
  244. innodb_parallel_read_threads 4
  245. innodb_print_all_deadlocks OFF
  246. innodb_print_ddl_logs OFF
  247. innodb_purge_batch_size 300
  248. innodb_purge_rseg_truncate_frequency 128
  249. innodb_purge_threads 4
  250. innodb_random_read_ahead OFF
  251. innodb_read_ahead_threshold 56
  252. innodb_read_io_threads 4
  253. innodb_read_only OFF
  254. innodb_redo_log_archive_dirs
  255. innodb_redo_log_capacity 104857600
  256. innodb_redo_log_encrypt OFF
  257. innodb_replication_delay 0
  258. innodb_rollback_on_timeout OFF
  259. innodb_rollback_segments 128
  260. innodb_segment_reserve_factor 12.500000
  261. innodb_sort_buffer_size 1048576
  262. innodb_spin_wait_delay 6
  263. innodb_spin_wait_pause_multiplier 50
  264. innodb_stats_auto_recalc ON
  265. innodb_stats_include_delete_marked OFF
  266. innodb_stats_method nulls_equal
  267. innodb_stats_on_metadata OFF
  268. innodb_stats_persistent ON
  269. innodb_stats_persistent_sample_pages 20
  270. innodb_stats_transient_sample_pages 8
  271. innodb_status_output OFF
  272. innodb_status_output_locks OFF
  273. innodb_strict_mode ON
  274. innodb_sync_array_size 1
  275. innodb_sync_spin_loops 30
  276. innodb_table_locks ON
  277. innodb_temp_data_file_path ibtmp1:12M:autoextend
  278. innodb_temp_tablespaces_dir ./#innodb_temp/
  279. innodb_thread_concurrency 0
  280. innodb_thread_sleep_delay 10000
  281. innodb_tmpdir
  282. innodb_undo_directory ./
  283. innodb_undo_log_encrypt OFF
  284. innodb_undo_log_truncate ON
  285. innodb_undo_tablespaces 2
  286. innodb_use_fdatasync OFF
  287. innodb_use_native_aio ON
  288. innodb_validate_tablespace_paths ON
  289. innodb_version 8.0.33
  290. innodb_write_io_threads 4
  291. insert_id 0
  292. interactive_timeout 28800
  293. internal_tmp_mem_storage_engine TempTable
  294. join_buffer_size 262144
  295. keep_files_on_create OFF
  296. key_buffer_size 16777216
  297. key_cache_age_threshold 300
  298. key_cache_block_size 1024
  299. key_cache_division_limit 100
  300. keyring_operations ON
  301. large_files_support ON
  302. large_page_size 0
  303. large_pages OFF
  304. last_insert_id 0
  305. lc_messages en_US
  306. lc_messages_dir /usr/share/mysql/
  307. lc_time_names en_US
  308. license GPL
  309. local_infile OFF
  310. lock_wait_timeout 31536000
  311. locked_in_memory OFF
  312. log_bin ON
  313. log_bin_basename /var/lib/mysql/binlog
  314. log_bin_index /var/lib/mysql/binlog.index
  315. log_bin_trust_function_creators OFF
  316. log_bin_use_v1_row_events OFF
  317. log_error /var/log/mysql/error.log
  318. log_error_services log_filter_internal; log_sink_internal
  319. log_error_suppression_list
  320. log_error_verbosity 2
  321. log_output FILE
  322. log_queries_not_using_indexes OFF
  323. log_raw OFF
  324. log_replica_updates ON
  325. log_slave_updates ON
  326. log_slow_admin_statements OFF
  327. log_slow_extra OFF
  328. log_slow_replica_statements OFF
  329. log_slow_slave_statements OFF
  330. log_statements_unsafe_for_binlog ON
  331. log_throttle_queries_not_using_indexes 0
  332. log_timestamps UTC
  333. long_query_time 10.000000
  334. low_priority_updates OFF
  335. lower_case_file_system OFF
  336. lower_case_table_names 0
  337. mandatory_roles
  338. master_info_repository TABLE
  339. master_verify_checksum OFF
  340. max_allowed_packet 67108864
  341. max_binlog_cache_size 18446744073709547520
  342. max_binlog_size 104857600
  343. max_binlog_stmt_cache_size 18446744073709547520
  344. max_connect_errors 100
  345. max_connections 151
  346. max_delayed_threads 20
  347. max_digest_length 1024
  348. max_error_count 1024
  349. max_execution_time 0
  350. max_heap_table_size 16777216
  351. max_insert_delayed_threads 20
  352. max_join_size 18446744073709551615
  353. max_length_for_sort_data 4096
  354. max_points_in_geometry 65536
  355. max_prepared_stmt_count 16382
  356. max_relay_log_size 0
  357. max_seeks_for_key 18446744073709551615
  358. max_sort_length 1024
  359. max_sp_recursion_depth 0
  360. max_user_connections 0
  361. max_write_lock_count 18446744073709551615
  362. min_examined_row_limit 0
  363. myisam_data_pointer_size 6
  364. myisam_max_sort_file_size 9223372036853727232
  365. myisam_mmap_size 18446744073709551615
  366. myisam_recover_options BACKUP
  367. myisam_sort_buffer_size 8388608
  368. myisam_stats_method nulls_unequal
  369. myisam_use_mmap OFF
  370. mysql_native_password_proxy_users OFF
  371. mysqlx_bind_address 127.0.0.1
  372. mysqlx_compression_algorithms DEFLATE_STREAM,LZ4_MESSAGE,ZSTD_STREAM
  373. mysqlx_connect_timeout 30
  374. mysqlx_deflate_default_compression_level 3
  375. mysqlx_deflate_max_client_compression_level 5
  376. mysqlx_document_id_unique_prefix 0
  377. mysqlx_enable_hello_notice ON
  378. mysqlx_idle_worker_thread_timeout 60
  379. mysqlx_interactive_timeout 28800
  380. mysqlx_lz4_default_compression_level 2
  381. mysqlx_lz4_max_client_compression_level 8
  382. mysqlx_max_allowed_packet 67108864
  383. mysqlx_max_connections 100
  384. mysqlx_min_worker_threads 2
  385. mysqlx_port 33060
  386. mysqlx_port_open_timeout 0
  387. mysqlx_read_timeout 30
  388. mysqlx_socket /var/run/mysqld/mysqlx.sock
  389. mysqlx_ssl_ca
  390. mysqlx_ssl_capath
  391. mysqlx_ssl_cert
  392. mysqlx_ssl_cipher
  393. mysqlx_ssl_crl
  394. mysqlx_ssl_crlpath
  395. mysqlx_ssl_key
  396. mysqlx_wait_timeout 28800
  397. mysqlx_write_timeout 60
  398. mysqlx_zstd_default_compression_level 3
  399. mysqlx_zstd_max_client_compression_level 11
  400. net_buffer_length 16384
  401. net_read_timeout 30
  402. net_retry_count 10
  403. net_write_timeout 60
  404. new OFF
  405. ngram_token_size 2
  406. offline_mode OFF
  407. old OFF
  408. old_alter_table OFF
  409. open_files_limit 10000
  410. optimizer_max_subgraph_pairs 100000
  411. optimizer_prune_level 1
  412. optimizer_search_depth 62
  413. optimizer_switch index_merge=on,index_merge_union=on,index_merge_so...
  414. optimizer_trace enabled=off,one_line=off
  415. optimizer_trace_features greedy_search=on,range_optimizer=on,dynamic_range=...
  416. optimizer_trace_limit 1
  417. optimizer_trace_max_mem_size 1048576
  418. optimizer_trace_offset -1
  419. original_commit_timestamp 36028797018963968
  420. original_server_version 999999
  421. parser_max_mem_size 18446744073709551615
  422. partial_revokes OFF
  423. password_history 0
  424. password_require_current OFF
  425. password_reuse_interval 0
  426. performance_schema ON
  427. performance_schema_accounts_size -1
  428. performance_schema_digests_size 10000
  429. performance_schema_error_size 5288
  430. performance_schema_events_stages_history_long_size 10000
  431. performance_schema_events_stages_history_size 10
  432. performance_schema_events_statements_history_long_... 10000
  433. performance_schema_events_statements_history_size 10
  434. performance_schema_events_transactions_history_lon... 10000
  435. performance_schema_events_transactions_history_siz... 10
  436. performance_schema_events_waits_history_long_size 10000
  437. performance_schema_events_waits_history_size 10
  438. performance_schema_hosts_size -1
  439. performance_schema_max_cond_classes 150
  440. performance_schema_max_cond_instances -1
  441. performance_schema_max_digest_length 1024
  442. performance_schema_max_digest_sample_age 60
  443. performance_schema_max_file_classes 80
  444. performance_schema_max_file_handles 32768
  445. performance_schema_max_file_instances -1
  446. performance_schema_max_index_stat -1
  447. performance_schema_max_memory_classes 450
  448. performance_schema_max_metadata_locks -1
  449. performance_schema_max_mutex_classes 350
  450. performance_schema_max_mutex_instances -1
  451. performance_schema_max_prepared_statements_instanc... -1
  452. performance_schema_max_program_instances -1
  453. performance_schema_max_rwlock_classes 60
  454. performance_schema_max_rwlock_instances -1
  455. performance_schema_max_socket_classes 10
  456. performance_schema_max_socket_instances -1
  457. performance_schema_max_sql_text_length 1024
  458. performance_schema_max_stage_classes 175
  459. performance_schema_max_statement_classes 219
  460. performance_schema_max_statement_stack 10
  461. performance_schema_max_table_handles -1
  462. performance_schema_max_table_instances -1
  463. performance_schema_max_table_lock_stat -1
  464. performance_schema_max_thread_classes 100
  465. performance_schema_max_thread_instances -1
  466. performance_schema_session_connect_attrs_size 512
  467. performance_schema_setup_actors_size -1
  468. performance_schema_setup_objects_size -1
  469. performance_schema_show_processlist OFF
  470. performance_schema_users_size -1
  471. persist_only_admin_x509_subject
  472. persist_sensitive_variables_in_plaintext ON
  473. persisted_globals_load ON
  474. pid_file /var/lib/mysql/lattepanda.pid
  475. plugin_dir /usr/lib/mysql/plugin/
  476. port 3306
  477. preload_buffer_size 32768
  478. print_identified_with_as_hex OFF
  479. profiling OFF
  480. profiling_history_size 15
  481. protocol_compression_algorithms zlib,zstd,uncompressed
  482. protocol_version 10
  483. proxy_user
  484. pseudo_replica_mode OFF
  485. pseudo_slave_mode OFF
  486. pseudo_thread_id 7911
  487. query_alloc_block_size 8192
  488. query_prealloc_size 8192
  489. rand_seed1 0
  490. rand_seed2 0
  491. range_alloc_block_size 4096
  492. range_optimizer_max_mem_size 8388608
  493. rbr_exec_mode STRICT
  494. read_buffer_size 131072
  495. read_only OFF
  496. read_rnd_buffer_size 262144
  497. regexp_stack_limit 8000000
  498. regexp_time_limit 32
  499. relay_log lattepanda-relay-bin
  500. relay_log_basename /var/lib/mysql/lattepanda-relay-bin
  501. relay_log_index /var/lib/mysql/lattepanda-relay-bin.index
  502. relay_log_info_file relay-log.info
  503. relay_log_info_repository TABLE
  504. relay_log_purge ON
  505. relay_log_recovery OFF
  506. relay_log_space_limit 0
  507. replica_allow_batching ON
  508. replica_checkpoint_group 512
  509. replica_checkpoint_period 300
  510. replica_compressed_protocol OFF
  511. replica_exec_mode STRICT
  512. replica_load_tmpdir /tmp
  513. replica_max_allowed_packet 1073741824
  514. replica_net_timeout 60
  515. replica_parallel_type LOGICAL_CLOCK
  516. replica_parallel_workers 4
  517. replica_pending_jobs_size_max 134217728
  518. replica_preserve_commit_order ON
  519. replica_skip_errors OFF
  520. replica_sql_verify_checksum ON
  521. replica_transaction_retries 10
  522. replica_type_conversions
  523. replication_optimize_for_static_plugin_config OFF
  524. replication_sender_observe_commit_only OFF
  525. report_host
  526. report_password
  527. report_port 3306
  528. report_user
  529. require_row_format OFF
  530. require_secure_transport OFF
  531. resultset_metadata FULL
  532. rpl_read_size 8192
  533. rpl_stop_replica_timeout 31536000
  534. rpl_stop_slave_timeout 31536000
  535. schema_definition_cache 256
  536. secondary_engine_cost_threshold 100000.000000
  537. secure_file_priv /var/lib/mysql-files/
  538. select_into_buffer_size 131072
  539. select_into_disk_sync OFF
  540. select_into_disk_sync_delay 0
  541. server_id 1
  542. server_id_bits 32
  543. server_uuid 13ae3759-1efd-11ed-9b66-00e04c0ba112
  544. session_track_gtids OFF
  545. session_track_schema ON
  546. session_track_state_change OFF
  547. session_track_system_variables time_zone,autocommit,character_set_client,characte...
  548. session_track_transaction_info OFF
  549. sha256_password_auto_generate_rsa_keys ON
  550. sha256_password_private_key_path private_key.pem
  551. sha256_password_proxy_users OFF
  552. sha256_password_public_key_path public_key.pem
  553. show_create_table_skip_secondary_engine OFF
  554. show_create_table_verbosity OFF
  555. show_gipk_in_create_table_and_information_schema ON
  556. show_old_temporals OFF
  557. skip_external_locking ON
  558. skip_name_resolve OFF
  559. skip_networking OFF
  560. skip_replica_start OFF
  561. skip_show_database OFF
  562. skip_slave_start OFF
  563. slave_allow_batching ON
  564. slave_checkpoint_group 512
  565. slave_checkpoint_period 300
  566. slave_compressed_protocol OFF
  567. slave_exec_mode STRICT
  568. slave_load_tmpdir /tmp
  569. slave_max_allowed_packet 1073741824
  570. slave_net_timeout 60
  571. slave_parallel_type LOGICAL_CLOCK
  572. slave_parallel_workers 4
  573. slave_pending_jobs_size_max 134217728
  574. slave_preserve_commit_order ON
  575. slave_rows_search_algorithms INDEX_SCAN,HASH_SCAN
  576. slave_skip_errors OFF
  577. slave_sql_verify_checksum ON
  578. slave_transaction_retries 10
  579. slave_type_conversions
  580. slow_launch_time 2
  581. slow_query_log OFF
  582. slow_query_log_file /var/lib/mysql/lattepanda-slow.log
  583. socket /var/run/mysqld/mysqld.sock
  584. sort_buffer_size 262144
  585. source_verify_checksum OFF
  586. sql_auto_is_null OFF
  587. sql_big_selects ON
  588. sql_buffer_result OFF
  589. sql_generate_invisible_primary_key OFF
  590. sql_log_bin ON
  591. sql_log_off OFF
  592. sql_mode ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_...
  593. sql_notes ON
  594. sql_quote_show_create ON
  595. sql_replica_skip_counter 0
  596. sql_require_primary_key OFF
  597. sql_safe_updates OFF
  598. sql_select_limit 18446744073709551615
  599. sql_slave_skip_counter 0
  600. sql_warnings OFF
  601. ssl_ca ca.pem
  602. ssl_capath
  603. ssl_cert server-cert.pem
  604. ssl_cipher
  605. ssl_crl
  606. ssl_crlpath
  607. ssl_fips_mode OFF
  608. ssl_key server-key.pem
  609. ssl_session_cache_mode ON
  610. ssl_session_cache_timeout 300
  611. statement_id 1151955
  612. stored_program_cache 256
  613. stored_program_definition_cache 256
  614. super_read_only OFF
  615. sync_binlog 1
  616. sync_master_info 10000
  617. sync_relay_log 10000
  618. sync_relay_log_info 10000
  619. sync_source_info 10000
  620. system_time_zone CEST
  621. table_definition_cache 2000
  622. table_encryption_privilege_check OFF
  623. table_open_cache 4000
  624. table_open_cache_instances 16
  625. tablespace_definition_cache 256
  626. temptable_max_mmap 1073741824
  627. temptable_max_ram 1073741824
  628. temptable_use_mmap ON
  629. terminology_use_previous NONE
  630. thread_cache_size 9
  631. thread_handling one-thread-per-connection
  632. thread_stack 1048576
  633. time_zone SYSTEM
  634. timestamp 1688073784.830778
  635. tls_ciphersuites
  636. tls_version TLSv1.2,TLSv1.3
  637. tmp_table_size 16777216
  638. tmpdir /tmp
  639. transaction_alloc_block_size 8192
  640. transaction_allow_batching OFF
  641. transaction_isolation REPEATABLE-READ
  642. transaction_prealloc_size 4096
  643. transaction_read_only OFF
  644. transaction_write_set_extraction XXHASH64
  645. unique_checks ON
  646. updatable_views_with_limit YES
  647. use_secondary_engine ON
  648. version 8.0.33-0ubuntu0.22.04.2
  649. version_comment (Ubuntu)
  650. version_compile_machine x86_64
  651. version_compile_os Linux
  652. version_compile_zlib 1.2.13
  653. wait_timeout 28800
  654. warning_count 0
  655. windowing_use_high_precision ON
  656. xa_detach_on_prepare ON

答案1

得分: 0

经过几天的努力解决这个问题,我成功找到了原因。我的服务器和域名是通过CloudFlare隧道配置的,以确保在任何端口,甚至80端口上都不会暴露IP地址。更多信息请参考这里:
https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/

原来,通过这样的隧道传输的流量在某种程度上受到限制,可能是速率限制。一旦我重新配置了DNS并在A记录中指定了服务器的直接IP地址,服务器就可以处理数千个请求而没有任何问题。

如果将来有人遇到类似问题并且同时使用这样的隧道,记得要注意这个限制。

英文:

After a few days of struggling with this problem, I managed to find the cause. My server and domain was configured through the CloudFlare tunnel so as not to expose the IP address in any way on any port, even 80. more information available here:
https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/

it turns out that the traffic that goes through such a tunnel is somehow limited - maybe it's a rate limit. as soon as I reconfigured the dns and indicated the direct IP address of the server in the A record. The server handles thousands of requests without any problem.

If someone in the future would have a problem with this and uses such a tunnel at the same time, it is worth remembering about this limitation

huangapple
  • 本文由 发表于 2023年6月29日 22:59:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/76582268.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定