免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12
最近访问板块 发新帖
楼主: luomingxue
打印 上一主题 下一主题

Redhat Enterprise Advanced Server 3.0性能问题 [复制链接]

论坛徽章:
0
11 [报告]
发表于 2004-03-13 01:12 |只看该作者

Redhat Enterprise Advanced Server 3.0性能问题

speed of Journaling File System ext3
You can set Journaling mode data=ordered(default)/writeback/journal/

I can do it use mount/umount

But I couldn't figure out how to do it in fstab.
in fstab
/dev/md2                /boot                   ext3    -o data=writeback        1 2

showed error in this entry when bootup.  
Anybody can help how to add mount options in fstab?
What the correct syntas?

speed of Journaling File System ext3 from redhat
http://www.redhat.com/support/wpapers/redhat/ext3/index.html#speed

论坛徽章:
0
12 [报告]
发表于 2004-03-13 10:46 |只看该作者

Redhat Enterprise Advanced Server 3.0性能问题

i'll test system under different kernels.
Someone said
2.4.22-1.2115.nptlsmp from fedora solved his I/O probs.
I ued 2.4.22-1.2174 does not work.

run the following program
./test_write aaa 20 200

and do
/sbin/hdparm -Tt /dev/md2
while the program is running

from
http://www.redhat.com/archives/taroon-list/2003-December/msg00174.html
test_write.c
#include <stdio.h>;
#include <unistd.h>;
#include <errno.h>;
#include <stdlib.h>;
#include <string.h>;
#include <sys/types.h>;
#include <sys/stat.h>;
#include <fcntl.h>;
#include <sys/time.h>;


#define LOG_FILENAME "/tmp/error.log"
#define MAX_FILE_NAME        32
#define MILLISEC_DIFF(new, old, diff)   {                               \
        (diff) = (((new).tv_sec  - (old).tv_sec)  * 1000L ) +           \
                 (((new).tv_usec - (old).tv_usec) / 1000L );            \
}

int main(int argc, char* argv[]) {

        char* data, log_str[1024], filename[MAX_FILE_NAME];
        int frequency, chunk_len, flags, elapsed, interval, sleep_time,
                fd = -1, fd2 = -1;
        struct timeval t1, t2;
        mode_t          mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
       

        if(argc != 4) {
                printf("usage: test_writes filename frequency(eg. 20 for 50 ms) write_size(Bytes)\n";
                _exit(1);
        }
       
        bzero(filename, MAX_FILE_NAME);
        strncpy(filename, argv[1], MAX_FILE_NAME -1);
        frequency = atoi(argv[2]);
        chunk_len = atoi(argv[3]);

        printf("filename <%s>; frequency <%d>; chunk_len <%d>;\n", filename, frequency, chunk_len);

        flags = O_CREAT | O_WRONLY | O_TRUNC;
        fd2 = open(LOG_FILENAME, O_WRONLY | O_CREAT | O_APPEND, mode);
        fd = open(filename, flags);

        if(fd < 0) {
                perror("Unable to open the input file";
                _exit(2);
        }
       
        if(fd2 < 0) {
                perror("Unable to open the log file";
                _exit(2);
        }

        data = (char*) malloc(sizeof(char)*chunk_len);
        if(data == NULL) {
                perror("Unable to allocate the input buffer";
                _exit(3);
        }

        interval = (int)(((double)1000/frequency));
        while(1) {
                gettimeofday(&t1, NULL);
                write(fd, data, chunk_len);
                gettimeofday(&t2, NULL);
                MILLISEC_DIFF(t2, t1, elapsed);
                if(elapsed >;= interval)  {
                        sprintf(log_str,"<%ld>;<%ld>; write to file <%s>;<%d>;\n", t1.tv_sec, t1.tv_usec/1000L, filename, elapsed);
                        write(fd2, log_str, strlen(log_str));
                }
                sleep_time = (interval - elapsed)*1000;
                if(sleep_time >; 0)        
                        usleep(sleep_time);
        }
}

论坛徽章:
0
13 [报告]
发表于 2004-03-14 02:56 |只看该作者

Redhat Enterprise Advanced Server 3.0性能问题

Final update:

Added 1G memory module,total memory 768M to 1.5G,
Change kernel to
2.4.22-1.2115

No change to kjournald.

No high iowait time anymore!
mission accomplished!

open question:
1. how to write -o data=writeback in fstab, anybody can give me an example?
2. how to check which process is using cpu, memory?
3. MYsql performance may need to be tuned, any tips?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP