-
Notifications
You must be signed in to change notification settings - Fork 371
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from alu234/master
update: 2 articles
- Loading branch information
Showing
3 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
数据库引擎是用于存储、处理和保护数据的核心服务 | ||
|
||
1.事务 | ||
|
||
InnoDB 支持事务,事务安全。Myisam 非事务安全,也不支持事务 | ||
|
||
2.锁 | ||
|
||
innoDb 行级锁,myisam 针对表加锁 | ||
|
||
3.索引 | ||
|
||
innodb 不支持全文索引,myisam 支持全局索引 | ||
|
||
4.适用场景 | ||
|
||
myisam 效率快于 innodb ,适用于小型应用,扩平台支持。大量查询 select | ||
|
||
innodb 支持事务,也有 ACID 的特性还有 insert update 对于事务的控制操作 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
查看 SYN 队列 | ||
|
||
就是查看处在 SYN_RECV 状态的进程连接个数 | ||
|
||
``` | ||
netstat -natp | grep SYN_RECV | wc -l | ||
``` | ||
|
||
查看溢出情况 | ||
|
||
``` | ||
netstat -s | ||
``` | ||
|
||
预防 SYN 攻击 | ||
|
||
- 增大半连接队列 | ||
|
||
- 开启 SYN cookies 算法 | ||
|
||
- 减少 SYN+ACK 重传次数 | ||
|
||
当服务端受到 SYN 攻击时,就会有大量处于 SYN_REVC 状态的 TCP 连接,处于这个状态的 TCP 会重传 SYN+ACK ,当重传超过次数达到上限后,就会断开连接。那我们减少了重传次数,就会加速断开连接,这里可以联想如果在第三次握手失败了之后的场景 |