superset连接sqlite频繁断开

  出现上述现象的原因是SQLite只支持库级锁,不支持并发执行写操作,即使是不同的表,同一时刻也只能进行一个写操作。例如,事务T1在表A新插入一条数据,事务T2在表B中更新一条已存在的数据,这两个操作是不能同时进行的,只能顺序进行。这会导致superset在运行一段时间后报上面的错误.

 

解决方法: 用nginx + 官方推荐的 gunicorn起多线程,简单说就是一个线程挂了,让线程A进入等待队列。线程B完成操作后,再调用函数释放资源,这样线程A就可以继续执行了。  

pip3 install gunicorn

gunicorn -w 10 --timeout 120 -b 0.0.0.0:6666 --limit-request-line 0 --limit-request-field_size 0 --statsd-host localhost:8125 superset:app


nginx配置:
server {
listen 80;
server_name superset.fengfeng.com;
root /usr/share/nginx/html;

# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;

location / {
proxy_pass http://192.168.56.101:6666;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}

原文地址:https://www.cnblogs.com/hongfeng2019/p/11279160.html