menu LittleJake's Blog
color_lens
avatar
Jake Liu
Never Settle
creative commons by-nc-sa
hit
Category
keyboard_arrow_down

© 2024 LittleJake's Blog.

萌ICP备20223020号

2020 - 1

head-img

cloudflare

According to the TOS of CloudFlare that CDN only support port 80 (native HTTP) and port 443(native HTTPS).
You must change your port 80 to others if you want to use in China. Besides, there is a block on China Telecom that IPV6 port 80 (or like port 8080) can only be accessed in their network.

Preparation

  • A domain hosted in the CloudFlare.
  • A terminal (Mobile, Router, PC, etc.)
...

head-img

整体架构

架构选择

平台并没有采用主流架构:Java Web来处理高并发。由于Java Web的复杂度和迭代性难度大,快速开发的PHP就是不二的代替。

因此,平台使用PHP版本7.2nts,加上Redis处理并发,(MariaDB)MySQL5.6保存计费信息,系统选择为Centos7。Lua作为API直接写Redis,采用OpenResty。

机器配置:Intel(R) Xeon(R) CPU E5-2697 v2 @ 2.70GHz + DDR3 RECC 98G

出现的问题

不止在架构上,系统上的破事也挺多的。

  • 系统出现磁盘错误,文件系统直接变RO,需要修复
  • 系统默认配置最大打开文件数hard&soft、连接优化、最大端口使用数
  • Redis默认最大maxclients为10000,高并发下最好使用Redis连接池或者框架支持的persistent长连接
  • MySQL最大连接数100,通过修改my.cnf或者控制台输入...
Theme