找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1892|回复: 0

可道云kodexplorer搭建私有云后的配置优化

[复制链接]
发表于 2024-4-17 17:53:20 | 显示全部楼层 |阅读模式
<div><p style="box-sizing: border-box; margin-bottom: 16px; padding: 0px; direction: ltr; font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quotingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: 16px; line-height: 26px; text-rendering: optimizelegibility; color: rgb(79, 79, 79); text-align: justify; font-variant-ligatures: common-ligatures; background-color: rgb(255, 255, 255);">一、上传下载速度优化<br style="box-sizing: border-box;" />首先明确可道云没有对上传下载做任何限制,速度快慢和网络环境有关。可道云是基于http上传,所以和其他http上传速度基本一致;可以对比其他web系统或网站说附件上传速度。同其他例如webdav、FTP、QQ传输等软件底层协议不一样;传输速度也会不一样。</p><p style="box-sizing: border-box; margin-bottom: 16px; padding: 0px; direction: ltr; font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quotingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: 16px; line-height: 26px; text-rendering: optimizelegibility; color: rgb(79, 79, 79); text-align: justify; font-variant-ligatures: common-ligatures; background-color: rgb(255, 255, 255);">传输速度受三方面影响:</p><p style="box-sizing: border-box; margin-bottom: 16px; padding: 0px; direction: ltr; font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quotingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: 16px; line-height: 26px; text-rendering: optimizelegibility; color: rgb(79, 79, 79); text-align: justify; font-variant-ligatures: common-ligatures; background-color: rgb(255, 255, 255);">本机客户端:网卡、连接方式(有线、无线)、本机磁盘IO负载情况;<br style="box-sizing: border-box;" />网络环境:网络带宽、wifi还是网线等造成的影响;网络环境复杂、或使用人多时路由器或交换机处理速度也都会是瓶颈之一。<br style="box-sizing: border-box;" />服务器:受服务器负载、磁盘IO、服务器网络带宽等影响。同时受并发影响;比如20M上行带宽,10个人同时在上传或下载,那么每个人平均就是2M/s<br style="box-sizing: border-box;" />可道云为了能在更多的服务器环境下良好运行,各方面配置是以兼容性为主,可能并不是最优配置。性能调优可以参考配置如下。</p><ol style="box-sizing: border-box; margin: 0px 0px 24px; padding: 0px; direction: ltr; font-size: 1&#46;1em; line-height: 1&#46;6; list-style-position: outside; font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quotingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; color: rgba(0, 0, 0, 0&#46;75); font-variant-ligatures: common-ligatures; background-color: rgb(255, 255, 255);"><li style="box-sizing: border-box; margin: 8px 0px 0px 40px; padding: 0px; direction: ltr; list-style-type: decimal;">服务器环境<br style="box-sizing: border-box;" />推荐linux系统服务器:如centos7、RedHat、Ubuntu<br style="box-sizing: border-box;" />推荐nginx + php7 组合;nginx比Apache、IIS各方面效率更优</li></ol><p style="box-sizing: border-box; margin-bottom: 16px; padding: 0px; direction: ltr; font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quotingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: 16px; line-height: 26px; text-rendering: optimizelegibility; color: rgb(79, 79, 79); text-align: justify; font-variant-ligatures: common-ligatures; background-color: rgb(255, 255, 255);">2&#46;修改php&#46;ini上传限制</p><pre class="prettyprint" style="box-sizing: border-box; position: relative; font-family: Consolas, Inconsolata, Courier, monospace; text-wrap: wrap; margin-top: 0px; margin-bottom: 24px; padding: 8px 16px 6px 56px; direction: ltr; overflow: auto hidden; line-height: 22px; background-color: rgb(40, 44, 52); border-width: initial; border-style: none; border-color: initial; font-variant-ligatures: common-ligatures;"><code class="has-numbering" style="box-sizing: border-box; font-family: Consolas, Inconsolata, Courier, monospace; color: rgb(171, 178, 191); padding: 0&#46;5em; line-height: 22px; border-radius: 4px; display: block; overflow-x: auto; text-wrap: nowrap; overflow-wrap: normal; text-size-adjust: none;">max_execution_time = 3600
max_input_time = 3600
post_max_size = 150M
upload_max_filesize = 150M
</code><ul class="pre-numbering" style="box-sizing: border-box; margin: 0px; padding: 8px 0px; direction: ltr; font-size: inherit; line-height: 1&#46;6; list-style: none; font-family: inherit; position: absolute; width: 48px; top: 0px; left: 0px; text-align: right;"><li style="box-sizing: border-box; margin: 0px; padding: 0px 8px; direction: ltr; font-size: inherit; list-style: none; border-right: 1px solid rgb(197, 197, 197); color: rgb(153, 153, 153);">1</li><li style="box-sizing: border-box; margin: 0px; padding: 0px 8px; direction: ltr; font-size: inherit; list-style: none; border-right: 1px solid rgb(197, 197, 197); color: rgb(153, 153, 153);">2</li><li style="box-sizing: border-box; margin: 0px; padding: 0px 8px; direction: ltr; font-size: inherit; list-style: none; border-right: 1px solid rgb(197, 197, 197); color: rgb(153, 153, 153);">3</li><li style="box-sizing: border-box; margin: 0px; padding: 0px 8px; direction: ltr; font-size: inherit; list-style: none; border-right: 1px solid rgb(197, 197, 197); color: rgb(153, 153, 153);">4</li></ul></pre><p style="box-sizing: border-box; margin-bottom: 16px; padding: 0px; direction: ltr; font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quotingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: 16px; line-height: 26px; text-rendering: optimizelegibility; color: rgb(79, 79, 79); text-align: justify; font-variant-ligatures: common-ligatures; background-color: rgb(255, 255, 255);">3&#46;修改可道云配置<br style="box-sizing: border-box;" />在config/下新建 setting_user&#46;php文件;粘贴如下内容;(已存在则略过)</p><pre class="prettyprint" style="box-sizing: border-box; position: relative; font-family: Consolas, Inconsolata, Courier, monospace; text-wrap: wrap; margin-top: 0px; margin-bottom: 24px; padding: 8px 16px 6px 56px; direction: ltr; overflow: auto hidden; line-height: 22px; background-color: rgb(40, 44, 52); border-width: initial; border-style: none; border-color: initial; font-variant-ligatures: common-ligatures;"><code class="has-numbering" style="box-sizing: border-box; font-family: Consolas, Inconsolata, Courier, monospace; color: rgb(171, 178, 191); padding: 0&#46;5em; line-height: 22px; border-radius: 4px; display: block; overflow-x: auto; text-wrap: nowrap; overflow-wrap: normal; text-size-adjust: none;">&lt;?php
//分片上传: 每个切片5M,需要php&#46;ini 中upload_max_filesize大于此值
$GLOBALS['config']['settings']['updloadChunkSize'] = 1024*1024*5;   
//上传并发数量; 推荐15个并发;
$GLOBALS['config']['settings']['updloadThreads'] = 15;
</code><ul class="pre-numbering" style="box-sizing: border-box; margin: 0px; padding: 8px 0px; direction: ltr; font-size: inherit; line-height: 1&#46;6; list-style: none; font-family: inherit; position: absolute; width: 48px; top: 0px; left: 0px; text-align: right;"><li style="box-sizing: border-box; margin: 0px; padding: 0px 8px; direction: ltr; font-size: inherit; list-style: none; border-right: 1px solid rgb(197, 197, 197); color: rgb(153, 153, 153);">1</li><li style="box-sizing: border-box; margin: 0px; padding: 0px 8px; direction: ltr; font-size: inherit; list-style: none; border-right: 1px solid rgb(197, 197, 197); color: rgb(153, 153, 153);">2</li><li style="box-sizing: border-box; margin: 0px; padding: 0px 8px; direction: ltr; font-size: inherit; list-style: none; border-right: 1px solid rgb(197, 197, 197); color: rgb(153, 153, 153);">3</li><li style="box-sizing: border-box; margin: 0px; padding: 0px 8px; direction: ltr; font-size: inherit; list-style: none; border-right: 1px solid rgb(197, 197, 197); color: rgb(153, 153, 153);">4</li><li style="box-sizing: border-box; margin: 0px; padding: 0px 8px; direction: ltr; font-size: inherit; list-style: none; border-right: 1px solid rgb(197, 197, 197); color: rgb(153, 153, 153);">5</li><li style="box-sizing: border-box; margin: 0px; padding: 0px 8px; direction: ltr; font-size: inherit; list-style: none; border-right: 1px solid rgb(197, 197, 197); color: rgb(153, 153, 153);">6</li><li style="box-sizing: border-box; margin: 0px; padding: 0px 8px; direction: ltr; font-size: inherit; list-style: none; border-right: 1px solid rgb(197, 197, 197); color: rgb(153, 153, 153);">7</li></ul></pre><p style="box-sizing: border-box; margin-bottom: 16px; padding: 0px; direction: ltr; font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quotingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: 16px; line-height: 26px; text-rendering: optimizelegibility; color: rgb(79, 79, 79); text-align: justify; font-variant-ligatures: common-ligatures; background-color: rgb(255, 255, 255);">4&#46;nginx + php-fpm上传优化<br style="box-sizing: border-box;" />在nginx&#46;conf中添加如下代码,参考,更多nginx优化</p><p style="box-sizing: border-box; margin-bottom: 16px; padding: 0px; direction: ltr; font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quotingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: 16px; line-height: 26px; text-rendering: optimizelegibility; color: rgb(79, 79, 79); text-align: justify; font-variant-ligatures: common-ligatures; background-color: rgb(255, 255, 255);">#使用共享内存做临时存贮提高上传速度,共享内存需要大一些,否则上传大文件内存不足</p><pre class="prettyprint" style="box-sizing: border-box; position: relative; font-family: Consolas, Inconsolata, Courier, monospace; text-wrap: wrap; margin-top: 0px; margin-bottom: 24px; padding: 8px 16px 6px 56px; direction: ltr; overflow: auto hidden; line-height: 22px; background-color: rgb(40, 44, 52); border-width: initial; border-style: none; border-color: initial; font-variant-ligatures: common-ligatures;"><code class="has-numbering" style="box-sizing: border-box; font-family: Consolas, Inconsolata, Courier, monospace; color: rgb(171, 178, 191); padding: 0&#46;5em; line-height: 22px; border-radius: 4px; display: block; overflow-x: auto; text-wrap: nowrap; overflow-wrap: normal; text-size-adjust: none;">client_body_in_file_only clean;
client_body_temp_path /dev/shm 1 2;
fastcgi_param  REQUEST_BODY_FILE  $request_body_file;
</code><ul class="pre-numbering" style="box-sizing: border-box; margin: 0px; padding: 8px 0px; direction: ltr; font-size: inherit; line-height: 1&#46;6; list-style: none; font-family: inherit; position: absolute; width: 48px; top: 0px; left: 0px; text-align: right;"><li style="box-sizing: border-box; margin: 0px; padding: 0px 8px; direction: ltr; font-size: inherit; list-style: none; border-right: 1px solid rgb(197, 197, 197); color: rgb(153, 153, 153);">1</li><li style="box-sizing: border-box; margin: 0px; padding: 0px 8px; direction: ltr; font-size: inherit; list-style: none; border-right: 1px solid rgb(197, 197, 197); color: rgb(153, 153, 153);">2</li><li style="box-sizing: border-box; margin: 0px; padding: 0px 8px; direction: ltr; font-size: inherit; list-style: none; border-right: 1px solid rgb(197, 197, 197); color: rgb(153, 153, 153);">3</li></ul></pre><p style="box-sizing: border-box; margin-bottom: 16px; padding: 0px; direction: ltr; font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quotingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: 16px; line-height: 26px; text-rendering: optimizelegibility; color: rgb(79, 79, 79); text-align: justify; font-variant-ligatures: common-ligatures; background-color: rgb(255, 255, 255);">二、系统安全优化<br style="box-sizing: border-box;" />1&#46;开启防跨站<br style="box-sizing: border-box;" />系统管理员可以访问服务器任意资源,如果不想这样,可以开启php防跨站,指定某个站点open_basedir,只能访问某个目录。可以有如下几种方式设置:更多请参考</p><pre class="prettyprint" style="box-sizing: border-box; position: relative; font-family: Consolas, Inconsolata, Courier, monospace; text-wrap: wrap; margin-top: 0px; margin-bottom: 24px; padding: 8px 16px 6px 56px; direction: ltr; overflow: auto hidden; line-height: 22px; background-color: rgb(40, 44, 52); border-width: initial; border-style: none; border-color: initial; font-variant-ligatures: common-ligatures;"><code class="has-numbering" style="box-sizing: border-box; font-family: Consolas, Inconsolata, Courier, monospace; color: rgb(171, 178, 191); padding: 0&#46;5em; line-height: 22px; border-radius: 4px; display: block; overflow-x: auto; text-wrap: nowrap; overflow-wrap: normal; text-size-adjust: none;"># 1)php&#46;ini 中配置
open_basedir = /home/wwwroot/:/tmp/
# 2)nginx中配置 fastcgi&#46;conf
fastcgi_param PHP_VALUE "open_basedir=$document_root:/tmp/";
# 3)apache 的 httpd&#46;conf 中Directory配置
"php_admin_value open_basedir none" #关闭
php_admin_value open_basedir "/home/wwwroot/:/tmp/:/var/tmp/:/proc/"
# 4)&#46;user&#46;ini 站点根目录
open_basedir = /home/wwwroot/:/tmp/
</code><ul class="pre-numbering" style="box-sizing: border-box; margin: 0px; padding: 8px 0px; direction: ltr; font-size: inherit; line-height: 1&#46;6; list-style: none; font-family: inherit; position: absolute; width: 48px; top: 0px; left: 0px; text-align: right;"><li style="box-sizing: border-box; margin: 0px; padding: 0px 8px; direction: ltr; font-size: inherit; list-style: none; border-right: 1px solid rgb(197, 197, 197); color: rgb(153, 153, 153);">1</li><li style="box-sizing: border-box; margin: 0px; padding: 0px 8px; direction: ltr; font-size: inherit; list-style: none; border-right: 1px solid rgb(197, 197, 197); color: rgb(153, 153, 153);">2</li><li style="box-sizing: border-box; margin: 0px; padding: 0px 8px; direction: ltr; font-size: inherit; list-style: none; border-right: 1px solid rgb(197, 197, 197); color: rgb(153, 153, 153);">3</li><li style="box-sizing: border-box; margin: 0px; padding: 0px 8px; direction: ltr; font-size: inherit; list-style: none; border-right: 1px solid rgb(197, 197, 197); color: rgb(153, 153, 153);">4</li><li style="box-sizing: border-box; margin: 0px; padding: 0px 8px; direction: ltr; font-size: inherit; list-style: none; border-right: 1px solid rgb(197, 197, 197); color: rgb(153, 153, 153);">5</li><li style="box-sizing: border-box; margin: 0px; padding: 0px 8px; direction: ltr; font-size: inherit; list-style: none; border-right: 1px solid rgb(197, 197, 197); color: rgb(153, 153, 153);">6</li><li style="box-sizing: border-box; margin: 0px; padding: 0px 8px; direction: ltr; font-size: inherit; list-style: none; border-right: 1px solid rgb(197, 197, 197); color: rgb(153, 153, 153);">7</li><li style="box-sizing: border-box; margin: 0px; padding: 0px 8px; direction: ltr; font-size: inherit; list-style: none; border-right: 1px solid rgb(197, 197, 197); color: rgb(153, 153, 153);">8</li><li style="box-sizing: border-box; margin: 0px; padding: 0px 8px; direction: ltr; font-size: inherit; list-style: none; border-right: 1px solid rgb(197, 197, 197); color: rgb(153, 153, 153);">9</li><li style="box-sizing: border-box; margin: 0px; padding: 0px 8px; direction: ltr; font-size: inherit; list-style: none; border-right: 1px solid rgb(197, 197, 197); color: rgb(153, 153, 153);">10</li><li style="box-sizing: border-box; margin: 0px; padding: 0px 8px; direction: ltr; font-size: inherit; list-style: none; border-right: 1px solid rgb(197, 197, 197); color: rgb(153, 153, 153);">11</li><li style="box-sizing: border-box; margin: 0px; padding: 0px 8px; direction: ltr; font-size: inherit; list-style: none; border-right: 1px solid rgb(197, 197, 197); color: rgb(153, 153, 153);">12</li></ul></pre><p style="box-sizing: border-box; margin-bottom: 16px; padding: 0px; direction: ltr; font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quotingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: 16px; line-height: 26px; text-rendering: optimizelegibility; color: rgb(79, 79, 79); text-align: justify; font-variant-ligatures: common-ligatures; background-color: rgb(255, 255, 255);">2&#46;开启登陆验证码<br style="box-sizing: border-box;" />设置方法:管理员登陆可道云:右上角菜单——系统设置——安全设置——开启登陆验证码</p><ol start="3" style="box-sizing: border-box; margin: 0px 0px 24px; padding: 0px; direction: ltr; font-size: 1&#46;1em; line-height: 1&#46;6; list-style-position: outside; font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; color: rgba(0, 0, 0, 0&#46;75); font-variant-ligatures: common-ligatures; background-color: rgb(255, 255, 255);"><li style="box-sizing: border-box; margin: 8px 0px 0px 40px; padding: 0px; direction: ltr; list-style-type: decimal;">其他服务器运维优化<br style="box-sizing: border-box;" />建议全站使用https,避免传输中数据被窃听。<br style="box-sizing: border-box;" />设置服务器防火墙,关闭无关端口<br style="box-sizing: border-box;" />关注安全相关新闻,保持服务器相关软件为最新版本。<br style="box-sizing: border-box;" />三、其他优化<br style="box-sizing: border-box;" />1&#46;静态资源配置到CDN<br style="box-sizing: border-box;" />对于访问量比较大的站点,可以将可道云的静态资源迁移到CDN。步骤如下:</li></ol><p style="box-sizing: border-box; margin-bottom: 16px; padding: 0px; direction: ltr; font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-size: 16px; line-height: 26px; text-rendering: optimizelegibility; color: rgb(79, 79, 79); text-align: justify; font-variant-ligatures: common-ligatures; background-color: rgb(255, 255, 255);">先将kod下面的static上传到相应cdn,获得对应访问static目录的域名,例如: <a href="http://cdn&#46;test&#46;com/static/" rel="nofollow,noindex" target="_blank" style="box-sizing: border-box; color: rgb(78, 161, 219); text-decoration-line: none; line-height: inherit; background-color: transparent;">http://cdn&#46;test&#46;com/static/</a><br style="box-sizing: border-box;" />配置setting_user&#46;php 配置cdn地址: 在config/下新建 setting_user&#46;php文件;粘贴如下内容;(已存在则不需要新建)</p><pre class="prettyprint" style="box-sizing: border-box; position: relative; font-family: Consolas, Inconsolata, Courier, monospace; text-wrap: wrap; margin-top: 0px; margin-bottom: 24px; padding: 8px 16px 6px 56px; direction: ltr; overflow: auto hidden; line-height: 22px; background-color: rgb(40, 44, 52); border-width: initial; border-style: none; border-color: initial; font-variant-ligatures: common-ligatures;"><code class="has-numbering" style="box-sizing: border-box; font-family: Consolas, Inconsolata, Courier, monospace; color: rgb(171, 178, 191); padding: 0&#46;5em; line-height: 22px; border-radius: 4px; display: block; overflow-x: auto; text-wrap: nowrap; overflow-wrap: normal; text-size-adjust: none;"> &lt;?php
$GLOBALS['config']['settings']['staticPath'] = "http://cdn&#46;test&#46;com/static/";</code></pre></div>
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|腾飞在线 ( 冀ICP备05002530号 )

GMT+8, 2026-2-13 07:01 , Processed in 0.084447 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表