分类 系统架构师 下的文章

我的本地环境是mac,用homebrew安装,后期使用比直接用官网安装包安装来的方便:
brew install postgresql
brew install slowhttptest
brew services start postgresql
initdb /usr/local/var/postgres
sudo chmod 775 /usr/local/var/postgres
sudo chown wayson /usr/local/var/postgres
initdb /usr/local/var/postgres
rm -rf /usr/local/var/postgres
initdb /usr/local/var/postgres
pg_ctl -D /usr/local/var/postgres -l logfile start
createdb
psql 进入控制台
接下来就需要创建用户,最好创建一下以postgres用户。

CREATE USER postgres WITH PASSWORD 'xxxx';#这里的密码”xxxx“由你自己来设置
删除默认生成的postgres数据库:

DROP DATABASE postgres;
创建属于用户postgres的数据库,名字也叫postgres,当然你也可以取名叫别的。

CREATE DATABASE postgres OWNER postgres;
将数据库权限赋予为postgres用户:

GRANT ALL PRIVILEGES ON DATABASE postgres to postgres;
再给用户postgres用户添加创建数据库的属性,可以使用postgres作为数据库的登录用户并管理数据库。

ALTER ROLE postgres CREATEDB;

这样Mac上的PostgreSQL就基本设置好了。

————————————————
版权声明:本文为CSDN博主「MaineCoon」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/Brookekitty/article/details/106192977

php-fpm优化

1、php-fpm优化参数介绍

他们分别是:pm、pm.max_children、pm.start_servers、pm.min_spare_servers、pm.max_spare_servers。

pm:表示使用那种方式,有两个值可以选择,就是static(静态)或者dynamic(动态)。

在更老一些的版本中,dynamic被称作apache-like。这个要注意看配置文件的说明。

- 阅读剩余部分 -

概念
LNMP中的N是nginx充当Web Server
内容的分发者,会在文件系统找到相应的文件,就返回给浏览器,如:nginx。如果是静态的文件,就可以直接返回,但是如果是index.php需要解析并执行的脚本文件时,Web Server就无力了,需要将请求转发给相应的脚本语言的解析器来解释并执行,最终将程序的执行结果,返回给Web Server,再返回给浏览器。
LNMP中的P是php充当后端的逻辑处理程序
那么php与nginx的常规协作方式是如何的呢?需要我们明确几个概念





- 阅读剩余部分 -