LR里组 vusers 进程 线程的关系

发表于:2007-8-16 14:09

字体: | 上一篇 | 下一篇 | 我要投稿

 作者:Zee    来源:Zee 的博客

  今天来说说LR里的组和用户的问题。
  前几天看到一个帖子问:一个组里10个用户和10个组每个组一个用户有什么区别?
  我们先看一下LR的官方帮助:
 
Multithreading
Vusers support multithread environments. The primary advantage of a multithread environment is the ability to run more Vusers per load generator. Only threadsafe protocols should be run as threads. (not applicable to Mercury Business Availability Center)
Note: The following protocols are not threadsafe: Sybase-Ctlib, Sybase-Dblib, Informix, Tuxedo, and PeopleSoft-Tuxedo.
o      To enable multithreading, click Run Vuser as a thread.
o      To disable multithreading and run each Vuser as a separate process, click Run Vuser as a process.
The Controller and Tuning Console use a driver program (such as mdrv.exe or r3vuser.exe) to run your Vusers. If you run each Vuser as a process, then the same driver program is launched (and loaded) into the memory again and again for every instance of the Vuser. Loading the same driver program into memory uses up large amounts of RAM (random access memory) and other system resources. This limits the numbers of Vusers that can be run on any load generator.
Alternatively, if you run each Vuser as a thread, the Controller or Tuning Console launches only one instance of the driver program (such as mdrv.exe), for every 50 Vusers (by default). This driver process/program launches several Vusers, each Vuser running as a thread. These threaded Vusers share segments of the memory of the parent driver process. This eliminates the need for multiple re-loading of the driver program/process saves much memory space, thereby enabling more Vusers to be run on a single load generator.
 
 
  从上面的描述可以看到,
  如果是线程安全的协议,在一个组(进程)里并发多个vusers,可以不用开那么进程。这可以减少系统的开销。
  如果不是线程安全的协议,我们需要开多个进程来处理Vusers。这样势必增加系统的开销。
  其实对现在的硬件来说,基本上客户端成为瓶颈的机会不是很大。(除非这公司太穷了)
^_^
 
 
  这里我做了个实验,画了一张表,来形象的说明一下组/vusers/线程/进程的关系。
注:这里,我假定的是10vsuers:
设置vusers按进程还是线程运行
Vusers(个/组)
组(个)
mmdrv.exe中的线程数(个/组)
Mmdrv.exe进程(个)
平均每个进程占的内存(k)
Mmdrv.exe占有内存总数(k)
线程
10
12
7,500
7,500
线程
10
10
5,150
51,500
进程
10
10
4,676
46,760
进程
10
10
5,150
51,500

  我这里脚本都是一样的。
  大家如果自己做实验,内存可能会不一样。
  在表里,我们可以很清楚的看到,进程多的时候,占用内存肯定是多的。
  如果在同一组里开多个线程,占用内存就少得多。
  我们还要注意一个细节就是在用线程来运行vusers的时候,每个进程中会多出几个线程来。
  这多出来的很个进程在做什么,我没有查它的API,我想可能是维护进程之间的运行。
 
  很显然的,还有个问题,就是哪个压力更大。
  这个问题也有些人在问,我想这个应该是很明显的吧。
  其实对服务器来说,只要是10个用户都在正常工作,而速度不会受到本地硬件的影响。
  对服务器的压力是一样的。
  这么来思考:
  假设来说。
  我们是从客户端来发数据库的,10个用户,如果一秒钟发20个数据包。
  那对服务器来说,收到的数据包都是一样多的。所以压力也会是一样的。
  那会不会存在在同一个进程里开10个线程速度更慢呢。
  这个,我以为不会的。
 
  所以我认为压力是一样的。
 
 


Trackback:http://tb.blog.csdn.net/TrackBack.aspx?PostId=1724912

 

《2023软件测试行业现状调查报告》独家发布~

精彩评论

  • belie
    2007-10-13 09:19:37

    不错,谢谢!!
    学习。。。。。。

  • alison.ieee
    2007-9-24 17:15:11

    好文章。加分

  • lytesting
    2007-9-13 17:41:06

    同意楼上

  • xiaoxue_ren_ren
    2007-8-17 16:18:05

    我觉得Vuser用户在客户端无论进程还是线程来并发,只能影响到客户端,至于服务器段呢?接受到的并发用户数都一样,所以给服务器承受的压力都是一样的。

  • alextowxm
    2007-8-17 12:58:35

    我同意楼上的 说法

  • ∮随风而去~
    2007-8-17 12:53:50

    有可能~

  • xiaogu
    2007-8-16 21:23:14

    10用户测试不出来吧

    我看多点测试用户才有效果吧

关注51Testing

相关阅读

联系我们

快捷面板 站点地图 联系我们 广告服务 关于我们 站长统计 发展历程

法律顾问:上海兰迪律师事务所 项棋律师
版权所有 上海博为峰软件技术股份有限公司 Copyright©51testing.com 2003-2024
投诉及意见反馈:webmaster@51testing.com; 业务联系:service@51testing.com 021-64471599-8017

沪ICP备05003035号

沪公网安备 31010102002173号