mysql本身是存在瓶颈的,当数据量达到千万级别以上,无论mysql如何优化,其性能都显著降低(有专门团队开发并改进mysql的除外)。 那么就有以下几种办法解决。
1.增加mysql配置中buffer和cache的数值,增加服务器cpu数量和内存大小。
2.使用第三方引擎或衍生版本。例如:Percona、MariaDB、TokuDB 3.迁移到其他数据库。例如:PostgreSQL、Oracle
最新文章
mysql itself has bottlenecks: once the data volume reaches the tens-of-millions level or above, no matter how you optimize mysql, its performance drops noticeably (unless you have a dedicated team developing and improving mysql). So here are a few ways to solve it.
- Increase the buffer and cache values in the mysql configuration, and add more server CPUs and memory.
- Use a third-party engine or a derivative version. For example: Percona, MariaDB, TokuDB 3. Migrate to another database. For example: PostgreSQL, Oracle
针对不同的业务需求来选择mysql存储引擎。 1.采用MyISAM引擎
- R/W>100:1且updae相对较少。
- 并发不高,不需要事务。
- 表数据量小。
- 硬件资源有限。
2.采用InnoDB引擎
Pick your MySQL storage engine according to the different business requirements. 1. Go with the MyISAM engine
- R/W > 100:1 and relatively few updates.
- Low concurrency, no need for transactions.
- Small amount of table data.
- Limited hardware resources.
- Go with the InnoDB engine
前辈们总结的经验,学习、学习。
1.尽量避免在列上进行运算,这样会导致索引失效。
例如:SELECT FROM t WHERE YEAR(d) >=2011; 优化为:SELECT FROM t WHERE d >=’2011-01-01’;
2.使用JOIN时,应该用小结果集驱动大结果集。
同时把复杂的JOIN查询拆分成多个QUERY。因为JOIN多个 表时,可能导致更多的锁定和堵塞。 SELECT * FROM a JOIN b ON a.id=b.id LEFT JOIN c ON c.time=a.date LEFT JOIN d ON c.pid=d.aid LEFT JOIN e ON e.cid=a.did
Experience summarized by the veterans — let’s learn from it.
1.Try to avoid performing operations on columns, as this makes the index unusable.
For example: SELECT FROM t WHERE YEAR(d) >=2011; optimized to: SELECT FROM t WHERE d >=’2011-01-01’;
2.When using JOIN, the small result set should drive the large result set.
At the same time, split complex JOIN queries into multiple QUERYs. Because joining multiple tables can lead to more locking and blocking. SELECT * FROM a JOIN b ON a.id=b.id LEFT JOIN c ON c.time=a.date LEFT JOIN d ON c.pid=d.aid LEFT JOIN e ON e.cid=a.did
无意间发现shodan可以搜索任何联网的设备(不多解释,你懂的)。在kali系统中可以配置shodan,也就是说你不用去 https://www.shodan.io/官网上搜索了,在kali终端直接敲命令就可以了。 首先,在shodan注册个免费账户 NO.1 
I stumbled on the fact that shodan can search any internet-connected device (no need to explain further, you know what I mean). You can configure shodan in a kali system — that is, you don’t have to go to the official https://www.shodan.io/ site to search; you can just type commands directly in the kali terminal. First, register a free account on shodan NO.1 
突然发现centos自带的火狐浏览器好卡,打开网页速度太慢了。就尝试装个谷歌浏览器,结果报错。
如下: http://dl.google.com/linux/rpm/stable/x86\_64/repodata/repomd.xml: [Errno 14] curl#7 - “Failed to connect to 2404:6800:4005:800::200e: 网络不可达” 反反复复换了几个地方都不行(网址被封了),干脆把镜像源换了。
I suddenly noticed that the Firefox browser that ships with CentOS was terribly laggy, and web pages opened far too slowly. So I tried installing Google Chrome, and got an error.
As follows: http://dl.google.com/linux/rpm/stable/x86\_64/repodata/repomd.xml: [Errno 14] curl#7 - “Failed to connect to 2404:6800:4005:800::200e: Network is unreachable” I tried several different places over and over with no luck (the address is blocked), so I simply swapped out the mirror source.
Linux CentOS 7[edit]
Reboot the Linux CentOS 7 system, then use the arrow keys to select the corresponding system in the screenshot below and press the “e” key.
CentOS 7下安装最新的Wine(wine1.7.33)可谓一波三折,对于我这种菜鸟级别的人来说,真不好装!不过好在终于能够使用了。
下面记录安装过程:以后有时间在详细叙说安装的各个步骤:
CentOS 7安装可以仿照:The right way to install Wine on CentOS 6 64bit 里面给出了详细步骤,下面就是仿照其安装的!
Installing the latest Wine (wine 1.7.33) on CentOS 7 was full of twists and turns. For a rookie like me, it really wasn’t easy to install! But thankfully I finally got it working.
Here’s a record of the installation process; I’ll describe each step in detail later when I have time:
Installing on CentOS 7 can follow: “The right way to install Wine on CentOS 6 64bit”, which gives detailed steps, and what follows imitates that installation!
深圳市人力资源和社会保障局:12333
福田区人力资源局:82918291-207
罗湖区人力资源局:25438399
南山区人力资源局:26665374
盐田区人力资源局:25228211
宝安区人力资源局:29990000
龙岗区人力资源局:28917170
光明新区社会建设局:88211961
坪山新区社会建设局:84649869
龙华新区社会建设局:23336155
大鹏新区社会建设局:28333608
Shenzhen Municipal Human Resources and Social Security Bureau: 12333
Futian District Human Resources Bureau: 82918291-207
Luohu District Human Resources Bureau: 25438399
Nanshan District Human Resources Bureau: 26665374
Yantian District Human Resources Bureau: 25228211
Bao’an District Human Resources Bureau: 29990000
Longgang District Human Resources Bureau: 28917170
Guangming New District Social Construction Bureau: 88211961
Pingshan New District Social Construction Bureau: 84649869
Longhua New District Social Construction Bureau: 23336155
Dapeng New District Social Construction Bureau: 28333608
深圳人可以拨打以下电话查询社保、公积金信息。比如提取住房公积金、贷款;医保报销的比例;怎样才能生育保险、享受待遇;漏交社保要怎么补缴、换地方工作后社保要怎么转移等等问题。
- 深圳社保局免费咨询热线:0755-96888、12333
- 少儿医保卡办理查询也可拨打:96888 (切记:查询需要本人身份证或社保号,建议你到当地社保局申请查询,可以得到满意的结果。)
- 住房公积金**:**12329 关于深圳人落户、居住证、身份证、驾驶证、通行证、出入境、寻人寻亲、物品招领、案件咨询等等问题。
- 深圳市公安局:0755—84463999、25572114、25576355 地址:深圳市罗湖区解放路4016号
- 公安局福田区分局:0755-82923357、84461070 地址:深圳市福田区金地工业区106栋福田公安分局行政服务中心一楼
- 公安局罗湖区分局:0755-84460482、25777777 地址:深圳市罗湖区湖贝路2000号二楼
- 公安局南山区分局:0755-84466523、26610013 地址:深圳市南山区南山大道3020号南山公安分局人口管理科 公安局宝安区分局**:**0755-85131409、27788047 地址:深圳市宝安区新安街道罗田路2号综合办证大厅
- 公安局龙岗区分局**:**0755-84468230、28916666 地 址:龙岗区布吉街道吉华路115号
- 公安局盐田区分局:0755-84460803、25550692 地址:盐田区深盐路2078
- 公安局龙华区分局:0755-85135135 地址:深圳市龙华新区梅龙大道98号B座龙华公安分局综合服务大厅1楼 公安局蛇口分局:0755-26691455 地址:深圳市蛇口花果路68号
- 公安局光明区分局:0755-84468776、27400074 地址:深圳市光明新区光明街道牛山路1号
- 公安局坪山区分局:0755-84443020 地址:深圳市坪山新区龙坪路1号综合办证大厅
- 公安局大鹏区分局**:0755-85136123 地址:深圳市大鹏新区岭澳村十一巷九号大鹏公安分局综合服务大厅 沙头角公安分局**:0755-25555999 地址:深圳市盐田区沙深路125
- 罗湖口岸公安分局**:**0755-82344111 地址:深圳市罗湖区和平路1001号
- 皇岗口岸公安分局**:**0755-83391185、84462110 地址:深圳市福田区福港路50号
- 机场公安分局**:**0755-27776530、27776031 地址:深圳市宝安区机场六道1005
People in Shenzhen can call the numbers below to check social security and housing fund information — for example, withdrawing from the housing provident fund, loans, the reimbursement ratio for medical insurance, how to get maternity insurance and the benefits it gives you, how to make up missed social security payments, how to transfer your social security after changing jobs, and so on.
- Shenzhen Social Security Bureau free consultation hotline: 0755-96888, 12333
- You can also call this to apply for or check a child’s medical insurance card: 96888 (Remember: a query needs the person’s ID card or social security number; it’s best to go to your local social security bureau and apply for the query there, and you’ll get a satisfactory result.)
- Housing provident fund**:** 12329 Questions about settling in Shenzhen, residence permits, ID cards, driving licences, travel permits, entry and exit, tracing people and relatives, lost and found items, case enquiries and so on.
- Shenzhen Municipal Public Security Bureau: 0755—84463999, 25572114, 25576355 Address: 4016 Jiefang Road, Luohu District, Shenzhen
- Public Security Bureau Futian District Sub-bureau: 0755-82923357, 84461070 Address: 1st floor, Administrative Service Centre of the Futian Public Security Sub-bureau, Building 106, Jindi Industrial Zone, Futian District, Shenzhen
- Public Security Bureau Luohu District Sub-bureau: 0755-84460482, 25777777 Address: 2nd floor, 2000 Hubei Road, Luohu District, Shenzhen
- Public Security Bureau Nanshan District Sub-bureau: 0755-84466523, 26610013 Address: Population Management Section, Nanshan Public Security Sub-bureau, 3020 Nanshan Avenue, Nanshan District, Shenzhen Public Security Bureau Bao’an District Sub-bureau**:** 0755-85131409, 27788047 Address: Comprehensive Permit Service Hall, 2 Luotian Road, Xin’an Subdistrict, Bao’an District, Shenzhen
- Public Security Bureau Longgang District Sub-bureau**:** 0755-84468230, 28916666 Address: 115 Jihua Road, Buji Subdistrict, Longgang District
- Public Security Bureau Yantian District Sub-bureau: 0755-84460803, 25550692 Address: 2078 Shenyan Road, Yantian District
- Public Security Bureau Longhua District Sub-bureau: 0755-85135135 Address: 1st floor, Comprehensive Service Hall of the Longhua Public Security Sub-bureau, Block B, 98 Meilong Avenue, Longhua New District, Shenzhen Public Security Bureau Shekou Sub-bureau: 0755-26691455 Address: 68 Huaguo Road, Shekou, Shenzhen
- Public Security Bureau Guangming District Sub-bureau: 0755-84468776, 27400074 Address: 1 Niushan Road, Guangming Subdistrict, Guangming New District, Shenzhen
- Public Security Bureau Pingshan District Sub-bureau: 0755-84443020 Address: Comprehensive Permit Service Hall, 1 Longping Road, Pingshan New District, Shenzhen
- Public Security Bureau Dapeng District Sub-bureau**: 0755-85136123 Address: Comprehensive Service Hall of the Dapeng Public Security Sub-bureau, No. 9, Lane 11, Ling’ao Village, Dapeng New District, Shenzhen Shatoujiao Public Security Sub-bureau**: 0755-25555999 Address: 125 Shashen Road, Yantian District, Shenzhen
- Luohu Port Public Security Sub-bureau**:** 0755-82344111 Address: 1001 Heping Road, Luohu District, Shenzhen
- Huanggang Port Public Security Sub-bureau**:** 0755-83391185, 84462110 Address: 50 Fugang Road, Futian District, Shenzhen
- Airport Public Security Sub-bureau**:** 0755-27776530, 27776031 Address: 1005 Jichang 6th Road, Bao’an District, Shenzhen
Two levels of nested foreach threw an error,
Warning: Invalid argument supplied for foreach()
Invalid argument. I debugged it myself for a long time without solving it. On Baidu I found an answer someone had given: $array =array(); if (is_array($array) && count($array)>0 ){ foreach($array as $val){ } } Add a check for foreach, and the whole problem is solved.
