- 博客(114)
- 收藏
- 关注
原创 CURD演示 2
<?php class UserAction extends Action{ public function index(){ echo "你好!"; $m=M('user'); $arr=$m->select(); #var_dump($arr); $this->assign('data',$arr); $this->display(); } public fun
2016-06-30 23:18:21 277
原创 测试关闭mojo utf-8
[root@wx03 ~]# cat test.pl use Mojolicious::Lite;use JSON qw/encode_json decode_json/; use Encode;no strict;use JSON; use Data::Dumper;no utf8;# /foo?user=sri get '/admin/api/menu' => sub {
2016-06-30 20:11:28 452
原创 mojo 关闭utf8
[root@wx03 ~]# cat test.pl use Mojolicious::Lite;use JSON qw/encode_json decode_json/; use Encode;no strict;use JSON; use Data::Dumper;#no utf8;# /foo?user=sri get '/admin/api/menu' => sub
2016-06-30 19:58:50 351
原创 mojo 默认启用utf-8
[root@dr-mysql01 ~]# cat f1.pl use Encode;print "验证111\n";my $d=encode_utf8('验证');print $d;print "\n";[root@dr-mysql01 ~]# perl f1.pl 验证111éªè¯ [root@dr-mysql01 ~]# mojo 默认开始utf-8 my
2016-06-30 19:24:49 470
原创 perl lwp 默认的请求头
[root@dr-mysql01 ~]# cat getx.pl use LWP::UserAgent; $ua = LWP::UserAgent->new;# @header = (# 'accept'=> "application/json",# 'content-type'=> "application/json", #'apix-key'=> "e7b00871
2016-06-30 17:37:52 392
原创 redis 获取key 过期时间
127.0.0.1:6379> keys *b4f107c6-e96c-4a1e-8402-a3be9a619847*1) "shiro_redis_session:b4f107c6-e96c-4a1e-8402-a3be9a619847"127.0.0.1:6379> get "shiro_redis_session:b4f107c6-e96c-4a1e-8402-a3be9a619847
2016-06-30 15:49:09 110466 4
原创 perl 使用cookie
use Net::SMTP;use LWP::UserAgent;use HTTP::Cookies;use HTTP::Headers;use HTTP::Response;use Encode;use Switch;use File::Temp qw/tempfile/;use HTTP::Date qw(time2iso str2time time2iso time2isoz
2016-06-30 14:32:46 1353
原创 perl lwp 获取请求头
[root@dr-mysql01 ~]# cat getx.pl use LWP::UserAgent; $ua = LWP::UserAgent->new; @header = ( 'accept'=> "application/json", 'content-type'=> "application/json", 'apix-key'=> "e7b00871640
2016-06-30 11:17:43 925
原创 ThinkPHP 3 的CURD管理用户信息 修改和删除
本节课大纲:一、ThinkPHP 3 的CURD管理用户信息 http://localhost:8080/thinkphp/index.php/User/index访问User类的index方法模板不存在[./Home/Tpl/User/index.html] 需要模板文件C:\wamp\www\thinkphp\Home\Tpl\User 模块名\方法.htm
2016-06-29 23:41:31 1601
原创 多个haproxy 之间跳转
C:\>ping wechatTest.winfae.com正在 Ping wechatTest.winfae.com [120.55.118.6] 具有 32 字节的数据:来自 120.55.118.6 的回复: 字节=32 时间=5ms TTL=54来自 120.55.118.6 的回复: 字节=32 时间=4ms TTL=54指向120.55.118.6的haproxy机器
2016-06-29 16:40:53 2773 1
原创 14.5.7 Storing InnoDB Undo Logs in Separate Tablespaces 存储InnoDB Undo logs 到单独的表空间
14.5.7 Storing InnoDB Undo Logs in Separate Tablespaces 存储InnoDB Undo logs 到单独的表空间在MySQL 5.6.3,你可以存储InnoDB undo logs 在一个或者多个单独的undo 表空间在system tablespace外面。这种布局不同于默认的配置 ,默认undo log 是system tab
2016-06-29 14:05:40 451
原创 14.5.5 Creating a File-Per-Table Tablespace Outside the Data Directory
14.5.5 Creating a File-Per-Table Tablespace Outside the Data Directory 创建一个File-Per-Table Tablespace 在Data Directory 外面:创建一个新的 InnoDB file-per-table tablespace 在一个指定的位置在MySQL data 目录之外,使用 DAT
2016-06-29 10:41:45 450
原创 php session 管理
function do_login(){ //获取用户名和密码信息,和数据库中比对 echo 111111111; dump($_POST); dump($_SESSION); echo 222222222; $username=$_POST['username']; $password=$_POST['password']; $code=$_POST['code
2016-06-29 09:19:45 291
原创 CURD特性
本节课大纲:一、ThinkPHP 3 的CURD介绍 (了解)二、ThinkPHP 3 读取数据 (重点) 对数据的读取 Read $m=new Model('User'); ##返回一个实例 $m=M('User'); select #调用实例下的方法 $m->select();//获取所有数据,以数组形式返回 find $m->find($id);//获取单条数据
2016-06-28 22:39:16 433
原创 php 写session
function do_login(){ //获取用户名和密码信息,和数据库中比对 echo 111111111; dump($_POST); dump($_SESSION); echo 222222222; $username=$_POST['username']; $password=$_POST['password']; $code=$_POST['code
2016-06-28 21:57:01 313
原创 14.5.4 InnoDB File-Per-Table Tablespaces 每个表一个文件
14.5.4 InnoDB File-Per-Table Tablespaces 每个表一个文件从历史上看, 所有的InnoDB 表和索引是存储在system 表空间,这个整体的方法是针对机器专注于数据库处理,精心策划的数据增长,任何磁盘存储分配给MySQL 不会用于其他目的。InnoDB的 file-per-table 表空间功能提供一个更加灵活的选择,每个InnoD
2016-06-28 17:31:49 842
原创 14.5.2 Changing the Number or Size of InnoDB Redo Log Files 改变InnoDB Redo Log Files的数量
14.5.2 Changing the Number or Size of InnoDB Redo Log Files 改变InnoDB Redo Log Files的数量改变InnoDB redo log files的数量 在MySQL 5.6.7或者更早版本,执行下面步骤:1.如果 innodb_fast_shutdown设置为2,set innodb_fast_shutdown
2016-06-28 13:32:23 316
原创 14.5.1 Resizing the InnoDB System Tablespace
14.5.1 Resizing the InnoDB System Tablespace 本节描述如何增加或者减少InnoDB 系统表空间的大小增加InnoDB 系统表空间的大小最简单的方式增加InnoDB 系统表空间的大小是配置它从一开始就自动增长。指定最后数据文件在表空间定义的自动增长属性, InnoDB 自动增加文件的大小 64MB增加当它空间不足的时候。
2016-06-28 13:15:25 573
原创 14.4.9 Configuring Spin Lock Polling 配置Spin lock 轮询:
14.4.9 Configuring Spin Lock Polling 配置Spin lock 轮询:很多InnoDB mutexes 和rw-locks 是保留一小段时间,在一个多核系统,它可以更加有效的对于一个thread 不断的检查如果 它需要一个mutex or rw-lock一段时间 在sleeping前。如果 mutex or rw-lock 变的可用在这个
2016-06-28 10:40:34 530
原创 14.4.8 Configuring the InnoDB Master Thread IO Rate 配置InnoDB Master Thread I/O Rate
14.4.8 Configuring the InnoDB Master Thread IO Rate 配置InnoDB Master Thread I/O Rate主的master thread 在InnoDB 是一个thread 在后台执行各种任务。很多那些任务是I/O相关的, 比如flush dirty pages 从buffer pool 或者从insert buffer
2016-06-27 17:12:36 279
原创 14.4.7 Configuring the Number of Background InnoDB IO Threads 配置 后台InnoDB IO Threads的数量
14.4.7 Configuring the Number of Background InnoDB IO Threads 配置 后台InnoDB IO Threads的数量InnoDB 使用background thread 来服务各种类型的I/O请求。你可以配置 后台threads的数量 , 服务read和write I/O在数据pages上,使用配置参数 innodb_re
2016-06-27 16:35:40 353
原创 14.4.6 Configuring Thread Concurrency for InnoDB 配置Thread 并发
14.4.6 Configuring Thread Concurrency for InnoDB 配置Thread 并发InnoDB 使用操作系统threads 来处理用户的事务请求。(事务可以执行很多请求到InnoDB 在它们提交或者回滚前)在现代的操作系统和多核服务器, 上下文切换是有效的,很多的负载运行很多在没有任何并发数限制。可扩展性改进在MySQL 5.5和以上版本
2016-06-27 15:59:07 489
原创 14.4.5 Configuring InnoDB Change Buffering 配置InnoDB Change Buffering
14.4.5 Configuring InnoDB Change Buffering 配置InnoDB Change Buffering当INSERT,UPDATE,和删除操作在表上操作, 索引列的值(特别是secondary keys的值)通常是不排序的,需要真正的I/O。InnoDB 有一个change buffer 来caches 改变到secondary index
2016-06-27 14:00:06 265
原创 14.4.4 Configuring the Memory Allocator for InnoDB InnoDB 配置内存分配器
14.4.4 Configuring the Memory Allocator for InnoDB InnoDB 配置内存分配器当InnoDB 被开发, 内分配齐 提供了与操作系统和运行库往往缺乏在性能和可扩展性,当时, 没有内存分配库调整对于多核CPUs.因此,InnoDB实现它自己的内存分配器在内存子系统里,这个分配器是有单个互斥锁保护的, 会成为一个瓶颈。InnoD
2016-06-27 11:05:45 259
原创 timeout connect 10000 # default 10 second time out if a backend is not found
timeout connect timeout contimeout (deprecated) Set the maximum time to wait for a connection attempt to a server to succeed. 设置最大值来等待一个连接尝试成功连接到一个服务器 如果serber 是和haproxy 在同一个LAN里,连接应该是立即的(
2016-06-27 10:03:31 600
原创 haproxy 服务端超时时间 timeout server 17000 --后台程序17秒没有响应,返回超时
haproxy 服务端超时时间:haproxy 配置:timeout server 17000 --后台程序17秒没有响应,返回超时Jun 27 09:29:56 localhost haproxy[13593]: 192.168.32.101:43552 [27/Jun/2016:09:29:39.002] www appserver_3000/webhost01_8001
2016-06-27 09:36:14 5747
原创 输出和模型使用 2
本节课大纲:一、ThinkPHP 3 的输出 (重点) a、通过 echo 等PHP原生的输出方式在页面中输出 b、通过display方法输出 想分配变量可以使用assign方法 c、修改左右定界符 休要修改配置文件中的配置项 'TMPL_L_DELIM'=>'<{', //修改左定界符 'TMPL_R_DELIM'=>'}>', //修改右定界符二、Thin
2016-06-26 23:38:21 493
原创 输出和模型使用 1
本节课大纲:一、ThinkPHP 3 的输出 (重点) a、通过 echo 等PHP原生的输出方式在页面中输出 b、通过display方法输出 想分配变量可以使用assign方法 c、修改左右定界符 休要修改配置文件中的配置项 'TMPL_L_DELIM'=>'<{', //修改左定界符 'TMPL_R_DELIM'=>'}>', //修改右定界符二
2016-06-26 14:04:33 458
原创 14.4.3.6 Fine-tuning InnoDB Buffer Pool Flushing 微调 InnoDB Buffer Pool 刷新:
14.4.3.6 Fine-tuning InnoDB Buffer Pool Flushing 微调 InnoDB Buffer Pool 刷新:innodb_flush_neighbors and innodb_lru_scan_depth 配置选项 让你微调flush处理的某些方面对于InnoDB buffer pool.那些选项主要帮助密集写负载。对于大量的DML 活动,f
2016-06-24 17:43:15 225
原创 14.4.3.5 Configuring InnoDB Buffer Pool Flushing 配置InnoDB Buffer Pool 刷新:
14.4.3.5 Configuring InnoDB Buffer Pool Flushing 配置InnoDB Buffer Pool 刷新:InnoDB执行某些任务在后台, 包括flush 脏数据(那些页已经被修改了但是没有会写到磁盘) 在Buffer pool里。InnoDB flush buffer pool pages 如果脏页的比例在buffer pool 已经大于或
2016-06-24 16:50:46 264
原创 14.4.3.4 Configuring InnoDB Buffer Pool Prefetching (Read-Ahead) 配置InnoDB Buffer pool 预读
14.4.3.4 Configuring InnoDB Buffer Pool Prefetching (Read-Ahead) 配置InnoDB Buffer pool 预读一个预读请求 是一个I/O请求来预取多个页 在buffer poo里 一般的,预计 那些页面很快会被需要。 请求把所有的pages 到一个extent.InnoDB 使用2种预读算法来改善性能。线性预
2016-06-24 15:47:28 338
原创 14.4.3.3 Making the Buffer Pool Scan Resistant
14.4.3.3 Making the Buffer Pool Scan Resistant 让Buffer Pool 扫描相比使用一个严格的LRU算法, InnoDB 使用一个技术来最小化数据的总量,带入到buffer pool不会被再次访问。目的是确保频繁访问的("hot") 页停留在buffer pool里,即使 预读和全表扫描把新的blocks 可能或者可能之后不
2016-06-24 14:39:22 263
原创 haproxy 看到的是https,后台是http的原因
https://www.zjtest6.com/admin/api/menuhaproxy 日志;Jun 24 13:23:02 localhost haproxy[23205]: 192.168.33.29:56800 [24/Jun/2016:13:23:02.677] www~ appserver_3000/webhost01_8001 2/0/6/12/20 200 154 -
2016-06-24 13:25:09 1861
原创 frontend http 前端名字定义问题
https://www.winfae.com/admin/api/menuhaproxy 日志:Jun 24 13:04:49 localhost haproxy[14817]: 115.236.160.82:55729 [24/Jun/2016:13:04:49.530] http~ appserver_3000/webhost01_8001 8/0/0/6/14 200 154 - -
2016-06-24 13:07:53 400
原创 haproxy 中的http请求和https请求
use Mojolicious::Lite;use JSON qw/encode_json decode_json/; use Encode;no strict;use JSON; # /foo?user=sri get '/admin/api/menu' => sub { my $c = shift; $c->render(text =>
2016-06-24 11:53:06 4312
原创 14.4.3.2 Configuring Multiple Buffer Pool Instances 配置多个buffer pool 实例:
14.4.3.2 Configuring Multiple Buffer Pool Instances 配置多个buffer pool 实例:对于系统 buffer pool 有多个G的范围, 把buffer pool 分成多个单独的实例可以改进并发,降低不同threads 读取和写到cached pages 的竞争。这个功能是典型的用于系统有多个G范围的buffer pool
2016-06-24 09:39:26 329
原创 3.1.2 MVC模式和URL访问
本节课大纲:一、什么是MVC //了解 M -Model 编写model类 对数据进行操作 使用Model类 来操作数据 V -View 编写html文件,页面呈现 C -Controller 编写类文件(UserAction.class.php) 二、ThinkPHP的MVC特点 //了解三、ThinkPHP的MVC对应的目录
2016-06-23 22:46:07 465
原创 14.4.3.1 The InnoDB Buffer Pool
14.4.3.1 The InnoDB Buffer Pool14.4.3.2 Configuring Multiple Buffer Pool Instances14.4.3.3 Making the Buffer Pool Scan Resistant14.4.3.4 Configuring InnoDB Buffer Pool Prefetching (Read-Ahead)14.4
2016-06-23 17:57:36 288
原创 14.4.2 Configuring InnoDB for Read-Only Operation 配置InnoDB 永于只读操作:
14.4.2 Configuring InnoDB for Read-Only Operation 配置InnoDB 永于只读操作:你可以查询InnoDB 表 MySQL 数据目录是在只读介质里,通过启用--innodb-read-only 配置选项在服务器启动时:如何启动:准备一个实例用于只读操作,确保所有需要的信息是被刷新到数据文件 在存储到只读介质之前。运行s
2016-06-23 10:30:40 734
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人