关于Web开发的相关程序,应用技巧及相关定义
Oct
29
周一的时候发现测试环境有一个命令执行后报
网上基本减于这个错误,基本上是c语言的编译问题,但我大php怎么会有这样的错误?
所以怀疑是系统内核错误.把容器重新打包一次.结果没有改善.
最后发现原为是同事在CommonLogic::__call(),再调用了一次,call_user_func_array([$this, $method_name], $agrs);
class CommonLogic{
function __call($method_name,$agrs){
if(anycheck()){
//and function
}else{
// 如果不符合的,就再调用一次,这个就变成了一个死循环.
// 因为__call就是类里没有对应的方法才会去调用,但这里又再调用一个不存在的方法
return call_user_func_array([$this, $method_name], $agrs)
}
}
}
这个错误算是概念不清引起的错误.
引用
segmentation fault(core dump)
网上基本减于这个错误,基本上是c语言的编译问题,但我大php怎么会有这样的错误?
所以怀疑是系统内核错误.把容器重新打包一次.结果没有改善.
最后发现原为是同事在CommonLogic::__call(),再调用了一次,call_user_func_array([$this, $method_name], $agrs);
class CommonLogic{
function __call($method_name,$agrs){
if(anycheck()){
//and function
}else{
// 如果不符合的,就再调用一次,这个就变成了一个死循环.
// 因为__call就是类里没有对应的方法才会去调用,但这里又再调用一个不存在的方法
return call_user_func_array([$this, $method_name], $agrs)
}
}
}
这个错误算是概念不清引起的错误.
Sep
10
场景一
我把develop分合并到master,但还没有推到服务端,这时候我想这个合并不要了.
git reset origin/master
git checkout -- .
git clean -fd
我把develop分合并到master,但还没有推到服务端,这时候我想这个合并不要了.
引用
git reset origin/master
git checkout -- .
git clean -fd
Jun
21
最近公司准备开始一个新项目,而这次客户要求是使用java.
为了节省时间的我,选择了若依后台系统.但发现没有整合oauth
(虽然其它版本有整合,但使用分离开发成本有点高.对于我们这种没有前后端分离的小团队不划算.)
为了节省时间的我,选择了若依后台系统.但发现没有整合oauth
(虽然其它版本有整合,但使用分离开发成本有点高.对于我们这种没有前后端分离的小团队不划算.)
Nov
27
最近在一台生产服务器上部署一个应用,因为原来的web服务器是使用apache,为了不影响原来的应用,所以新的服务也使用apache来运行。
<VirtualHost *:80>
ServerName myweb.com
AllowEncodedSlashes on # 确定是否允许通过 URL 中的编码路径分隔符
<IfModule proxy_module>
ProxyPreserveHost On # 使用传入的主机 HTTP 请求 Headers 进行代理请求
ProxyRequests Off # 启用转发(标准)代理请求
ProxyPass "/" "http://localhost:9000/" nocanon # 将远程服务器 Map 到本地服务器 URL 空间
ProxyPassReverse "/" "http://localhost:9000/" nocanon # 调整从反向代理服务器发送的 HTTP 响应 Headers 中的 URL
</IfModule>
# 转发websocket
RewriteEngine on
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]
RewriteRule .* ws://localhost:15674%{REQUEST_URI} [P]
</VirtualHost>
nocanon 是指原样转发
https://httpd.apache.org/docs/2.4/mod/core.html#allowencodedslashes
<VirtualHost *:80>
ServerName myweb.com
AllowEncodedSlashes on # 确定是否允许通过 URL 中的编码路径分隔符
<IfModule proxy_module>
ProxyPreserveHost On # 使用传入的主机 HTTP 请求 Headers 进行代理请求
ProxyRequests Off # 启用转发(标准)代理请求
ProxyPass "/" "http://localhost:9000/" nocanon # 将远程服务器 Map 到本地服务器 URL 空间
ProxyPassReverse "/" "http://localhost:9000/" nocanon # 调整从反向代理服务器发送的 HTTP 响应 Headers 中的 URL
</IfModule>
# 转发websocket
RewriteEngine on
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]
RewriteRule .* ws://localhost:15674%{REQUEST_URI} [P]
</VirtualHost>
nocanon 是指原样转发
https://httpd.apache.org/docs/2.4/mod/core.html#allowencodedslashes
Apr
22
先把结果抛出来,
run java:
end i:1000000000 count:499999999500000000 time:0.638
run C:
end i:1000000000 count 499999999500000000 time:0.641424
run go:
end i:1000000000 count:499999999500000000 time:1.277728
run pypy:
end i:1000000000 count:499999999500000000 time:3.81583285332
run php
end i:1000000000 count:499999999500000000 time:26.515455007553
run nodejs:
end i:1000000000 count:499999999500000000 time:148.331
run python:
^Tend i:1000000000 count:499999999500000000 time:193.98550415
以上的结果进行了golang和c的性能优化.
run java:
end i:1000000000 count:499999999500000000 time:0.638
run C:
end i:1000000000 count 499999999500000000 time:0.641424
run go:
end i:1000000000 count:499999999500000000 time:1.277728
run pypy:
end i:1000000000 count:499999999500000000 time:3.81583285332
run php
end i:1000000000 count:499999999500000000 time:26.515455007553
run nodejs:
end i:1000000000 count:499999999500000000 time:148.331
run python:
^Tend i:1000000000 count:499999999500000000 time:193.98550415
以上的结果进行了golang和c的性能优化.