feisky

云计算、虚拟化与Linux技术笔记
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 66 下一页

2012年4月9日

摘要: urllib.urlopen(url[, data[, proxies]]) : 创建一个表示远程url的类文件对象,然后像本地文件一样操作这个类文件对象来获取远程数据。参数url表示远程数据的路径,一般是网址;参数data表示以post方式提交到url的数据(玩过web的人应该知道提交数据的两种方式:post与get。如果你不清楚,也不必太在意,一般情况下很少用到这个参数);参数proxies用于设置代理(这里不详细讲怎么使用代理,感兴趣的看客可以去翻阅Python手册urllib模块)。urlopen返回 一个类文件对象,他提供了如下方法:read() , readline() , rea 阅读全文

posted @ 2012-04-09 18:18 feisky 阅读(1491) 评论(0) 推荐(0) 编辑

摘要: All low-level memory operations go through Xen.Guest OSes are responsible for allocating and initializing PTs for processes (restricted to read only access)allocates and initialize a page and register it with Xen to serve as the new PTDirect page writes are intercepted, validated and applied by the 阅读全文

posted @ 2012-04-09 15:51 feisky 阅读(1181) 评论(0) 推荐(0) 编辑

摘要: 链表是C语言编程中常用的数据结构,比如我们要建一个整数链表,一般可能这么定义: ? 1 2 3 4 struct int_node { int val; struct int_node *next; }; 为了实现链表的插入、删除、遍历等功能,另外要再实现一系列函数,比如: ? 1 2 3 4 5 6 7 8 9 void insert_node(struct int_node *head... 阅读全文

posted @ 2012-04-09 13:53 feisky 阅读(680) 评论(0) 推荐(0) 编辑

2012年4月6日

摘要: 查看进程14755(httpd)打开了哪些文件:localhost:~# lsof -p 14755COMMAND PID USER FD TYPE DEVICE SIZE NODE NAMEhttpd 14755 apache cwd DIR 8,1 4096 2 /httpd 14755 apache rtd DIR 8,1 4096 2 /httpd 14755 apache txt REG 8,1 332264 9241061 /usr/sbin/httpdhttpd 14755 apache DEL REG 0,9 34211 /dev/zerohttpd 14755 apache 阅读全文

posted @ 2012-04-06 13:52 feisky 阅读(1215) 评论(0) 推荐(0) 编辑

2012年4月5日

摘要: realloc 用过很多次了。无非就是将已经存在的一块内存扩大。char* p = malloc(1024);char* q = realloc(p,2048);现在的问题是我们应该如何处理指针 p。 刚开始按照我最直观的理解,如果就是直接将 p = NULL;。 到最后只需要释放 q的空间就可以了。因为最近在做个封装。结果在做单元测试的时候发现。有时候我在 free(q); 的时候会出错。这样我就郁闷了。后来仔细一跟踪,发现 realloc 完以后 q 和 p 的指针地址是一样。不过有时候又不一样。仔细查了下资料。得到如下信息: 1.如果 当前连续内存块足够 realloc 的... 阅读全文

posted @ 2012-04-05 21:37 feisky 阅读(512) 评论(0) 推荐(0) 编辑

摘要: linux进程的五种状态 运行 可中断 不可中断 僵尸 停止 遍历父进程和子进程 注:init进程是作为init_struct静态分配的。进程的创建linux中通过fork和exec实现进程的创建。fork通过拷贝当前进程来创建一个新的进程,再通过exec加载可执行文件并执行。fork采用的写时拷贝方法避免了不必要数据的拷贝,使得linux可以快速创... 阅读全文

posted @ 2012-04-05 15:53 feisky 阅读(983) 评论(1) 推荐(0) 编辑

摘要: 进程是执行期间的程序及其它所包含的资源的总称。 进程通过fork()系统调用产生,该系统调用通过复制一个现有进程来创建一个全新的进程。fork()调用一次返回两次:一次回到父进程、一次回到新创建的子进程。 进程描述符及任务结构 内核把进程放在task list的双向循环链表中,其中每一项都是一个task_struct结构(即进程描述符)。task_struct结构比较大(32位机... 阅读全文

posted @ 2012-04-05 15:47 feisky 阅读(499) 评论(0) 推荐(0) 编辑

摘要: Linux中一切都是文件,这样可以通过相同的系统调用接口来操作数据和设备。 处理器的运行状态可以分为: 运行于内核态,处于进程上下文中,代表某个进程执行了系统调用; 运行于内核态,处于中断上下文,代表正在处理中断; 运行于用户态,正在执行用户进程。 单内核与微内核 单内核:内核作为一个整体构成一个大过程,运行在一个地址空间中,这样的内核以单个二进制文件的形式存在。内核... 阅读全文

posted @ 2012-04-05 15:46 feisky 阅读(445) 评论(0) 推荐(0) 编辑

摘要: xm migrate源码分析xen动态迁移虚机的命令为:xm migrate --live <domain id> <destination machine>迁移的原理Xen live migration begins by sending a request, orreservation, to the target specifying the resources the migrating domain will need. If the target accepts the request, the source begins theiterative prec 阅读全文

posted @ 2012-04-05 15:34 feisky 阅读(1619) 评论(0) 推荐(0) 编辑

2012年4月1日

摘要: This article is written to address sometimes incorrect usage of the “dd” program to measure disk write performance on a VPS by some visitors of thelowendbox.comwebsite, and is originally based onthis question and my answer to it.Initially published on 2010-11-29.Q: What is the difference between the 阅读全文

posted @ 2012-04-01 10:30 feisky 阅读(431) 评论(0) 推荐(0) 编辑

2012年3月30日

摘要: 问题引入:问题是我们重装了一台电脑之后,发现apache的日志里突然增加了很多服务时间超长的请求,如下面两条:** - - 4913229 11227 [29/Mar/2012:09:59:58 +0800] "GET******* - - 4793564 9846 [29/Mar/2012:09:59:58 +0800] "GET *****请求服务时间都在4s以上!这绝对无法忍受啊!分析过程:但是,当我们:* 手动访问这台服务器之后,发现基本上请求都是正常响应的;* 从前端反向代理的日志来看,服务时间也是正常的;那这样推断,真相只有一个,那就是apache的日志时间记录 阅读全文

posted @ 2012-03-30 21:27 feisky 阅读(840) 评论(0) 推荐(0) 编辑

2012年3月29日

摘要: 同事推荐的一个Web自动化测试工具:Selenium IDE需要Firefox/Firebug,并安装Selenium IDE 插件下载地址:http://seleniumhq.org/download/ 阅读全文

posted @ 2012-03-29 16:41 feisky 阅读(424) 评论(0) 推荐(0) 编辑

摘要: Amazon EBS全称是Elastice Block Store, 功能是为EC2提供可靠的块设备存储, 对于用户来说EBS就是一个磁盘, 磁盘上面可以安装数据库、文件系统等各种应用,EBS主要用在亚马逊RDS服务。EBS的特性EBS是可靠存储设备, 支持在同一AZ内部复制。AFR(annual failure fate)是0.1%到0.5%,低于普通磁盘4%.支持在线创建point-in-time快照,快照以copy-on-write方式实现,快照之后被修改的数据块才真正占用空间,快照数据以压缩方式存储到S3。支持从快照创建volume,采用延时加载机制,即真正被访问时,才从S3加载数据块 阅读全文

posted @ 2012-03-29 10:30 feisky 阅读(2771) 评论(0) 推荐(0) 编辑

摘要: aws架构的总结http://openfoo.org/blog/amazon_ec2_underlying_architecture.htmlMany people know that Amazon Web Services are one of the big players in the cloud computing business, and especially their Infrastructure as a Service offering EC2 is becoming increasingly popular. Few people know that EC2 is pro 阅读全文

posted @ 2012-03-29 10:09 feisky 阅读(518) 评论(0) 推荐(0) 编辑

2012年3月27日

摘要: In this posting, I summarize my prior three posts on the three cloud computing offerings: Infrastructure as a Service (IaaS), Platform as a Service (PaaS) and Software as a Service (SaaS).I concentrate how the three offerings differ with respect to flexibility, maintenance and portability. One of th 阅读全文

posted @ 2012-03-27 13:18 feisky 阅读(561) 评论(0) 推荐(0) 编辑

上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 66 下一页
无觅相关文章插件,快速提升流量