我运行Cassandra docker容器:
docker pull cassandra
run --name cassandra -p 9042:9042 -p 9160:9160 -d cassandra
Run Code Online (Sandbox Code Playgroud)
netstat -tpln是:
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
LISTEN - tcp6 0 0 [::]:9160 [::]:*
LISTEN - tcp6 0 0 [::]:9042 [::]:*
Run Code Online (Sandbox Code Playgroud)
从本地cqlsh连接到C*是好的:
docker exec -it cassandra /bin/bash
#cqlsh
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.1.1 | CQL spec 3.3.1 | Native protocol v4]
Use HELP for help.
cqlsh> show host
Connected to Test Cluster at 127.0.0.1:9042.
Run Code Online (Sandbox Code Playgroud)
我安装本地cqlsh: …
Mysqlnd驱动程序PHP 5.6有机会使用异步查询http://php.net/manual/en/mysqli.reap-async-query.php
如何使用PDO进行异步查询?
它不起作用,代码(PHP异步mysql-query):
$dbConnectionOne = new \PDO($cnn0, $conf['user'], $conf['pass']);
$dbConnectionOne->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
$dbConnectionTwo = new \PDO($cnn0, $conf['user'], $conf['pass']);
$dbConnectionTwo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
$dbConnectionTwo->setAttribute(\PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, false);
$t = time();
$synchStmt = $dbConnectionOne->prepare('SELECT sleep(2)');
$synchStmt->execute();
$asynchStmt = $dbConnectionTwo->prepare('SELECT sleep(1)');
$asynchStmt->execute();
$measurementConfiguration = array();
foreach ($synchStmt->fetchAll() as $synchStmtRow) {
print_r($synchStmtRow);
}
while (($asynchStmtRow = $asynchStmt->fetch()) !== false) {
print_r($asynchStmtRow);
}
$t = time() - $t;
echo 'query execute ', $t, ' sec',PHP_EOL;
Run Code Online (Sandbox Code Playgroud)
除外2秒但结果= 3秒
我安装 luarocks:
$ sudo apt-get install luarocks
Run Code Online (Sandbox Code Playgroud)
我通过 luarocks 安装 lua-cjson:
$sudo luarocks install lua-cjson
Run Code Online (Sandbox Code Playgroud)
显示包:
$luarocks list
Installed rocks:
----------------
lua-cjson
2.1.0-1 (installed) - /usr/local/lib/luarocks/rocks
Run Code Online (Sandbox Code Playgroud)
所以,我看到包:
$luarocks show lua-cjson
License: MIT
Homepage: http://www.kyne.com.au/~mark/software/lua-cjson.php
Installed in: /usr/local
. . .
Modules:
cjson
lua2json
json2lua
cjson.util
lua-cjson
2.1.0-1 (installed) - /usr/local/lib/luarocks/rocks
Run Code Online (Sandbox Code Playgroud)
但是,Lua 看不到模块:
$lua
Lua 5.2.3 Copyright (C) 1994-2013 Lua.org, PUC-Rio
> require "cjson"
stdin:1: module 'cjson' not found:
....
$locate cjson.so
/usr/local/lib/lua/5.1/cjson.so
Run Code Online (Sandbox Code Playgroud)
这是什么错误??
该Web项目将静态内容放入一些/ content / img文件夹中。网址规则是:/ img / {some md5}但在文件夹中的位置:/ content / img / {前两位数字} /
例
url: example.com/img/fe5afe0482195afff9390692a6cc23e1
location: /www/myproject/content/img/fe/fe5afe0482195afff9390692a6cc23e1
Run Code Online (Sandbox Code Playgroud)
此nginx位置是正确的,但不安全(符号点在regexp中不好):
location ~ /img/(..)(.+)$ {
alias $project_home/content/img/$1/$1$2;
add_header Content-Type image/jpg;
}
Run Code Online (Sandbox Code Playgroud)
下一个位置更正确,但不起作用:
location ~ /img/([0-9a-f]\{2\})([0-9a-f]+)$ {
alias $project_home/content/img/$1/$1$2;
add_header Content-Type image/jpg;
}
Run Code Online (Sandbox Code Playgroud)
帮助我查找错误以获取更正确的Nginx位置。
运行以下内容可以显示进程的内存使用情况:
$ ps -C processname -o size
SIZE
3808
Run Code Online (Sandbox Code Playgroud)
有没有办法在不执行ps(或任何外部程序)或阅读的情况下检索此信息/proc?