shell:

  1. awk -F= '! /(^#|^$)/ { if ($2 != "") printf "%-34s = %s\n", $1,$2; else printf "%s\n", $1 }' /etc/my.cnf  
  1. awk '! /(^#|^$)/ {printf “%-34s %s %s\n”, $1, $2, $3}' /etc/my.cnf 

Perl:

  1. perl -ne 'm/^([^#][^\s=]+)\s*(=.*|)/ && printf("%-35s%s\n", $1, $2)' /etc/my.cnf 

本日志由 flyinweb 于 2009-06-30 13:57:50 发表到 技术文摘 中,目前已经被浏览 189 次,评论 0 次;

作者添加了以下标签: pretty-printmy.cnf

整理一个MySQL 5.1 的参数简表,共303个,方便平时查询

本日志由 flyinweb 于 2009-06-30 11:32:04 发表到 数据库技术 中,目前已经被浏览 701 次,评论 0 次;

作者添加了以下标签: MySQL参数

首页只显示了部分日志内容,要查看日志的全部内容请阅读全文

高速增长的访问量给社区网络的技术体系带来了巨大挑战。MySpace的开发者多年来不断重构站点软件、数据库和存储系 统,以期与自身的成长同步——目前,该站点月访问量已达400亿。绝大多数网站需要应对的流量都不及MySpace的一小部分,但那些指望迈入庞大在线市 场的人,可以从MySpace的成长过程学到知识。

本日志由 flyinweb 于 2009-06-30 11:25:01 发表到 技术文摘 中,目前已经被浏览 198 次,评论 0 次;

作者添加了以下标签: MySpace

首页只显示了部分日志内容,要查看日志的全部内容请阅读全文

MySQL优化 之 Discuz论坛优化 -- 续

很早以前写过一个文章,是关于discuz论坛的优化:MySQL优化 之 Discuz论坛优化。写的时候是2006年,没想到过了这么久,discuz论坛的问题还是困扰着很多网友,其实从各论坛里看到的问题总结出来,很关键的一点都是因为没有将数据表引擎转成InnoDB导致的,discuz在并发稍微高一点的环境下就表现的非常糟糕,产生大量的锁等待,这时候如果把数据表引擎改成InnoDB的话,我相信会好很多。这次就写个扫盲贴吧。

本日志由 flyinweb 于 2009-06-30 11:14:19 发表到 数据库技术 中,目前已经被浏览 174 次,评论 0 次;

作者添加了以下标签: MySQL优化

首页只显示了部分日志内容,要查看日志的全部内容请阅读全文

dell 2950 raid阵列冷迁移方法

作/译者:叶金荣(Email: ),来源:http://imysql.cn,转载请注明作/译者和出处,并且不能用于商业用途,违者必究。

假设2个服务器:
A (故障)
B (正常)
现在需要从 A => B

1. 关闭 A 和 B 服务器
2. 将 B 上的所有磁盘按顺序拔出,记录位置
3. 启动 B 服务器,进入 raid 配置界面,之前需要按 C 再按 Y 以进入
4. 进入 B 服务器的 raid 配置界面,清空 raid 配置信息 (reset config)
5. 将 A 上的所有磁盘按顺序拔出,记录位置,并且按这个位置插入到 B 中
6. 启动 B,进入 raid 配置界面,导入 raid 配置信息 (import config)
7. 重启 B,检查是否能正常启动系统
8. 完成

本日志由 flyinweb 于 2009-06-30 11:01:37 发表到 硬件及配置 中,目前已经被浏览 302 次,评论 0 次;

作者添加了以下标签: raid阵列冷迁移

How to implement COMET with PHP

Comet is a programming technique that enables web servers to send data to the client without having any need for the client to request it. This technique will produce more responsive applications than classic AJAX. In classic AJAX applications, web browser (client) cannot be notified in real time that the server data model has changed. The user must create a request (for example by clicking on a link) or a periodic AJAX request must happen in order to get new data fro the server.

I will now explain how to implement Comet with PHP programming language. I will demonstrate it on two demos which uses two techniques: the first one is based on hidden ”<iframe>” and the second one is based on classic AJAX non-returning request. The first demo will simply show the server date in real time on the clients and the second demo will display a mini-chat.

本日志由 flyinweb 于 2009-06-30 10:50:06 发表到 WEB应用开发 中,目前已经被浏览 302 次,评论 0 次;

作者添加了以下标签: PHPCOMET

首页只显示了部分日志内容,要查看日志的全部内容请阅读全文

 

 

Purpose of the entry

On Saturday June 13th 2009 I attended a talk by Eli White on Scalable web applications. Eli White previously worked at digg.com and now holds the position PHP Community Manager & DevZone Editor-in-Chief at Zend Technologies. When you hear him talk you immediately notice he has a high knowledge on programming, good practices and he is eager to distribute his knowledge and does it with passion. That explains his position at Zend. Eli gave for what I am concerned the best talk at the conference. Of course I didn’t attend all talks but I can hardly imagine a talk more interesting than this. He gave valuable tips on how to implement new projects with small tips. He showed you how you could already take some small steps that would lead to great benefit if your application would turn out to be mass consumed. The following entry is my interpretation of the talk itself.

Overview

  • What is scalable application design
  • Tip 1: load balancing the webserver
  • Tip 2: scaling from a single DB server to a Master-Slave setup
  • Tip 3: Partitioning, Vertical DB Scaling
  • Tip 4: Partitioning, horizontal DB Scaling
  • Tip 5: Application Level Partitioning
  • Tip 6: Caching to get around your database
  • Resources
  • Closing notes

What is scalable application design

Scalable application design first means, there is a design for an application. So there is a start on the application itself. It is no use designing and thinking on how to create your killer application by trying to fit in as many good practices as possible, so that in the end you feel discouraged in even beginning to program. First step in creating an application is actually beginning. Do not overkill the project with great ideas which will take forever to implement or require you to study till you drop. Does this mean you do not have to study or apply good design principles? Of course not, you should on a permanent basis. It should become a habit, a second nature. It just means do not overdo it in the way you will never begin the project at all. To make it easy for you Eli gave some practical tips which you can apply immediately without any problems and which doesn’t require any real study or understanding of design principles.

本日志由 flyinweb 于 2009-06-29 17:11:43 发表到 技术文摘 中,目前已经被浏览 352 次,评论 0 次;

作者添加了以下标签: Big-IPCachingCitrixhorizontal DB Scalingload balancingMaster-SlaveMemcachedscalable application designSquidVertical DB ScalingZend Server

首页只显示了部分日志内容,要查看日志的全部内容请阅读全文

在某些场景中,我们需要在前端放置一个Apache作为负载均衡器,后台有若干台Apusic或者其它的类似于Tomcat/WebLogic等应用服务器,客户端发送到Apache的请求,将被分配到后台的这些真正完成请求的服务器上。本文描述如何使用Apache作为负载均衡器的方法和不同的负载均衡的配置。

       在某些场景中,我们需要在前端放置一个Apache作为负载均衡器,后台有若干台Apusic或者其它的类似于Tomcat/WebLogic等应用服务器,客户端发送到Apache的请求,将被分配到后台的这些真正完成请求的服务器上。本文描述如何使用Apache作为负载均衡器的方法。

       我们假设Apahce安装在 myserver 这台服务器上,并且希望用户访问http://myserver/ 时,能够将这些请求被负载到后台的两台服务器上,分别是:http://192.168.6.37:8080/ 和 http://192.168.6.37:6888/

本日志由 flyinweb 于 2009-06-26 14:49:07 发表到 WEB服务器 中,目前已经被浏览 374 次,评论 0 次;

作者添加了以下标签: apache负载均衡

首页只显示了部分日志内容,要查看日志的全部内容请阅读全文

49750/63