2014年5月27日

调用门详解

摘要: 门描述符分为4种:调用门中断门陷阱门任务门中断门和陷阱门是特殊的调用门门描述符结构:实例: 阅读全文

posted @ 2014-05-27 19:03 andyhe 阅读(519) 评论(0) 推荐(0) 编辑

2014年5月26日

保护模式详解

摘要: 在ia32下,cpu有两种工作模式:实模式和保护模式。在实模式下,16位的寄存器用“段+偏移”的方法计算有效地址。段寄存器始终是16位的。在实模式下,段值xxxxh表示的以xxxx0h开始的一段内存。但在保护模式下,段寄存器的值变成了一个索引(还有附加信息)这个索引指向了一个数据结构的表(gdt/l... 阅读全文

posted @ 2014-05-26 19:30 andyhe 阅读(2154) 评论(0) 推荐(0) 编辑

2013年11月18日

zabbix搭建并结合mikoomi插件监控hadoop集群

摘要: 一、环境说明系统:CentOS release 6.4mysql5.1.67Apache/2.2.25二、安装php由于zabbix提供的frontends是php编写的,因此需要搭建lamp环境。wget http://us2.php.net/get/php-5.3.27.tar.bz2/from/cn2.php.net/mirrortar -jxvf php-5.3.27.tar.bz2cd php-5.3.27./configure --prefix=/usr/local/php --with-mysql=/usr/lib64/mysql/ --with-apxs2=/usr/local 阅读全文

posted @ 2013-11-18 21:14 andyhe 阅读(2340) 评论(0) 推荐(0) 编辑

2013年11月5日

join 中的on和where的区别

摘要: 数据库在通过连接两张或多张表来返回记录时,都会生成一张中间的临时表,然后再将这张临时表返回给用户。在使用leftjion时,on和where条件的区别如下:1、on条件是在生成临时表时使用的条件,它不管on中的条件是否为真,都会返回左边表中的记录。2、where条件是在临时表生成好后,再对临时表进行过滤的条件。这时已经没有leftjoin的含义了,条件不为真的就全部过滤掉。如下:两张表 number和agenumberageSELECT a.id,a.name,b.age FROM number a JOIN age b;SELECT a.id,a.name,b.age FROM number 阅读全文

posted @ 2013-11-05 13:01 andyhe 阅读(378) 评论(0) 推荐(0) 编辑

2013年10月23日

各web服务器的特点和优势

摘要: 1.Tomcat 和 Jetty 面向java语言 天生就是重量级的web服务器。性能一般2.IIS 只能在windows平台运行,windows作为服务器在稳定性与其他一些性能上不如类unix操作系统,因此,在需要高性能web服务器的场合下,IIS 可能会被冷落。3.Apache 的发展时期很长。它的优点很多,如,开源,稳定,跨平台等,但是它被设计成一个重量级的、不支持高并发的Web服务器。在Apache服务器上,如果有数以万计的并发HTTP请求同时访问,就会导致服务器上消耗大量内存,操作系统内核对成百上千的Apache进程做进程切换也会消耗大量的CPU资源,并导致HTTP请求的平均响应速度 阅读全文

posted @ 2013-10-23 12:21 andyhe 阅读(967) 评论(0) 推荐(0) 编辑

2013年8月1日

信号

摘要: #define SIGHUP 1 进程由於控制终端死去或者控制终端发出起命令 #define SIGINT 2 键盘中断所产生的信号 #define SIGQUIT 3 键盘终止 #define SIGILL 4 非法的指令 #define SIGTRAP 5 进程遇到一个追踪(trace)或者是一个中断嵌套 #define SIGABRT 6 由abort系统调用所产生的中断信号 #define SIGIOT 6 类似於SIGABRT #define SIGBUS 7 进程试图使用不合理的记忆体 #define SIGFPE 8 浮点异常 #define ... 阅读全文

posted @ 2013-08-01 09:47 andyhe 阅读(313) 评论(0) 推荐(0) 编辑

2013年7月31日

nginx main函数

摘要: 源代码:int ngx_cdeclmain(int argc, char *const *argv){ ngx_int_t i; ngx_log_t *log; ngx_cycle_t *cycle, init_cycle; ngx_core_conf_t *ccf; ngx_debug_init(); if (ngx_strerror_init() != NGX_OK) { return 1; } if (ngx_get_options(argc, argv) != NGX_OK) { ... 阅读全文

posted @ 2013-07-31 10:32 andyhe 阅读(749) 评论(0) 推荐(0) 编辑

2013年7月25日

nginx 日志模块

摘要: ngx_http_log_module.c数据结构typedef struct { void **main_conf; void **srv_conf; void **loc_conf;} ngx_http_conf_ctx_t;typedef struct ngx_http_log_op_s ngx_http_log_op_t;typedef u_char *(*ngx_http_log_op_run_pt) (ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t ... 阅读全文

posted @ 2013-07-25 17:07 andyhe 阅读(592) 评论(0) 推荐(0) 编辑

nginx 源码阅读 core

摘要: ngx_config.h数据对齐#define ngx_align(d, a) (((d) + (a - 1)) & ~(a - 1))ngx_core.h#define ngx_abs(value) (((value) >= 0) ? (value) : - (value))#define ngx_max(val1, val2) ((val1 val2) ? (val2) : (val1))数据结构ngx_arraytypedef struct { void *elts; ngx_uint_t nelts; size_t size; ... 阅读全文

posted @ 2013-07-25 10:54 andyhe 阅读(263) 评论(0) 推荐(0) 编辑

2013年7月19日

c字符数组里的中文

摘要: char *p ="你abc";strlen(p); //6 utf-8编码中 阅读全文

posted @ 2013-07-19 10:36 andyhe 阅读(520) 评论(0) 推荐(0) 编辑

导航