摘要: 多进程池Flask实战应用 import json import math import flask from concurrent.futures import ProcessPoolExecutor app = flask.Flask(__name__) process_pool = Proce 阅读全文
posted @ 2021-09-11 12:39 TY520 阅读(24380) 评论(0) 推荐(1) 编辑
摘要: 多线程池Flask实战应用 import json import time import flask from concurrent.futures import ThreadPoolExecutor app = flask.Flask(__name__) pool = ThreadPoolExec 阅读全文
posted @ 2021-09-11 12:38 TY520 阅读(24333) 评论(0) 推荐(0) 编辑
摘要: 多线程生产者消费者模型爬虫 import queue import requests from bs4 import BeautifulSoup import threading import time import random def craw(url): r = requests.get(ur 阅读全文
posted @ 2021-09-11 12:23 TY520 阅读(24416) 评论(0) 推荐(0) 编辑
摘要: type Products struct { gorm.Model SaleNum uint ` json:"saleNum"` CarNum uint ` json:"carNum"` } 上面的结构体 到数据库中查询的时候会自动将 saleNum carNum 转成 sale_num car_n 阅读全文
posted @ 2021-09-01 13:13 TY520 阅读(26723) 评论(0) 推荐(0) 编辑
摘要: 五大数据类型 string (动态字符串) hash (哈希表、压缩链表) list (双端链表、压缩链表) set (哈希表、整数集合) zset (跳表、压缩链表) 动态字符串 存储数字用int类型编码(8字节长整型)、存非数字小于39字节用embstr、大于39字节大于用raw编码。 stru 阅读全文
posted @ 2021-08-16 16:32 TY520 阅读(23849) 评论(0) 推荐(0) 编辑
摘要: Python垃圾回收和缓存管理 你有没有想过为什么我们频繁地使用Python敲代码做项目,实际上一直在生产对象并不断占用内存,而我们很少会去清理Python的内存,理论上来讲它总有一天把内存消耗殆尽(溢出),可每次打开Python却“安然无恙”?真的只是你的计算机内存很大吗? 并不是,一个成熟的软件 阅读全文
posted @ 2021-08-07 14:14 TY520 阅读(24553) 评论(0) 推荐(0) 编辑
摘要: Redis知识网络 作者:运维君莫笑 链接:https://www.zhihu.com/question/470465324/answer/2006650219 Redis为什么这么快? 根据官方数据。官方的基准程序测试,Redis 的 QPS 可以达到约 100000(每秒请求数) 基于内存实现 阅读全文
posted @ 2021-07-25 18:23 TY520 阅读(23600) 评论(0) 推荐(0) 编辑
摘要: # MySQL知识网络 ![image](https://img2023.cnblogs.com/blog/1455498/202309/1455498-20230904103900870-802775833.png) ### 引擎 - InnoDB 1. 支持表锁 、行锁 2. 支持事务 3. * 阅读全文
posted @ 2021-07-15 22:36 TY520 阅读(24795) 评论(0) 推荐(0) 编辑
摘要: 常用命令 验证 Kubernetes 集群状态 kubectl cluster-info kubectl get nodes 部署安装 kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.4/aio 阅读全文
posted @ 2021-07-15 22:35 TY520 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 制作SSL证书(签发免费证书) 下载证书生成器 wget https://pkg.cfssl.org/R1.2/cfssl_linux-amd64 wget https://pkg.cfssl.org/R1.2/cfssljson_linux-amd64 设置权限 chmod +x cfssl_li 阅读全文
posted @ 2021-07-15 20:20 TY520 阅读(25538) 评论(0) 推荐(0) 编辑