Fast or Slow

Just another WordPress.com weblog

Goranka Bjedov–talk about performance testing

Posted by joychester on November 21, 2007

This post is my best shot at explaining what I do, why I do it, and why I think it is the right thing to do. Performance testing is a category of testing that seems to evoke strong feelings in people: feelings of fear (Oh, my God, I have no idea what to do because performance testing is so hard!), feelings of inadequacy (We bought this tool that does every aspect of performance testing, we paid so much for it, and we are not getting anything done!), feelings of confusion (So, what the heck am I supposed to be doing again?), and I don’t think this is necessary.

Think of performance testing as another tool in your testing arsenal – something you will do when you need to. It explores several system qualities, that can be simplified to:

  • Speed – does the system respond quickly enough
  • Capacity – is the infrastructure sized adequately
  • Scalability – can the system grow to handle future volumes
  • Stability – does the system behave correctly under load

So, I do performance testing of a service when risk analysis indicates that failing in any of the above categories would be more costly to the company than performing the tests. (Which, if your name is Google and you care about your brand, happens with any service you launch.) Note that I am talking about services – I work almost exclusively with servers and spend no time worrying about client-side rendering/processing issues. While those are becoming increasingly more important, and have always been more complex than my work, I consider those to be a part of functionality tests, and they are designed, created and executed by functional testing teams.

Another interesting thing about performance testing is that you will never be able to be 100% “right” or 100% “done. Accept it, deal with it, and move on. Any system in existence today will depend on thousands of different parameters, and if I spent the time analyzing each one of them, understanding the relationships between each two or each three, graphing their impact curves, trying to non-dimensionalize them, I would still be testing my first service two years later. The thought of doing anything less filled me with horror (They cannot seriously expect me to provide meaningful performance results in less than a year, can they?) but I have since learned that I can provide at least 90% of meaningful information to my customers by applying only 10% of my total effort and time. And, 90% is more than enough for vast majority of problems.

So, here is what I really do – I create benchmarks. If I am lucky and have fantastic information about current usage patterns of a particular product (which I usually do), I will make sure this benchmark covers most operations that are top resource hogs (either per single use or cumulative). I’ll run this benchmark with different loads (number of virtual users) against a loosely controlled system (it would be nice to have 100 machines all to myself for every service we have, which I can use once a day or once a week, but that would be expensive and unrealistic) and investigate its behavior. Which transactions are taking the most time? Which transactions seem to get progressively worse with increasing load? Which transactions seem unstable (I cannot explain their behavior)? I call this exploratory performance testing, and I’ll repeat my tests until I am convinced I am observing real system behavior. While I am doing this, I make sure I am not getting biased by investigating the code. If I have questions, I ask programmers, but I know they are biased, and I will avoid getting biased myself!

Once I have my graphs (think, interesting transaction latencies and throughput vs. load here) I meet with the development team and discuss the findings. Usually, there is one or two things they know and have been working on, and a few more they were unaware of. Sometimes, they look over my benchmark and suggest changes (could you make the ratio 80:20, and not 50:50?) After this meeting, we create our final benchmark, I modify the performance testing scripts, and now this benchmark will run as often as possible, but hopefully at least once a night. And, here is the biggest value of this effort: if there is a code change that has impacted performance in an unacceptable way, you will find out about it the next day. Not a week or a month later (How many of us remember what we did in the last month? So, why expect our developers to do so?)

Here is why I think this is the right thing to do: I have seen more bad code developed as a result of premature performance optimizations – before the team even thought they had a problem! Please don’t do that. Develop your service in a clean, maintainable and extensible manner. Let me test it, and keep regression testing it. If we find we have a problem in a particular area, we can then address that problem easily – because our code is not obfuscated with performance optimization that have improved code paths that execute once a month by 5%.

I can usually do this in two – four weeks depending on the complexity of the project. Occasionally, we will find an issue that cannot be explained or understood with performance tests. At that point in time, we look under the hood. This is where performance profiling and performance modeling come in. And, both of those are considerably more complex than performance testing. Both great tools, but should be used only when the easy tool fails.

Tools, tools, tools… So, what do we use? I gave a presentation at Google Test Automation Conference in London on exactly this topic. I use open source tools. I discuss the reasons why in the presentation. In general, even if you have decided to go one of the other two routes (vendor tools or develop your own) check out what is available. You may find out that you will get a lot of information about your service using JMeter and spending some time playing around with it. Sure, you can also spend $500K and get similar information or you can spend two years developing “the next best performance testing tool ever,” but before you are certain free is not good enough, why would you want to?

Final word: monitor your services during performance tests. If you do not have service related monitoring developed and set up to be used during live operations, you do not need performance testing. If the risks of your service failing are not important enough that you would want to know about it *before* it happens, then you should not be wasting time or money on performance testing. I am incredibly lucky in this area – Google infrastructure is developed by a bunch of people who, if they had a meeting where the topic would be “How to make Goranka’s life easy?”, could not have done better. I love them – they make my job trivial. At a minimum, I monitor CPU, memory and I/O usage. I cannot see a case when you would want to do less, but you may want to do a lot more on occasion.

Posted in 测试技术 | Leave a Comment »

转眼间已经到了美国….

Posted by joychester on November 13, 2007

11月13号早上8点,nwa的空中客车准时到达了旧金山国际机场。一路上只睡了2个小时左右的时间,实在是空间太狭小。心情比刚登机的时候平静了很多,已经没有太多的激动:)观察窗外的变化,想想自己应该在这一个月里做些什么,甚至有了回家的冲动。。。。

在外面的旅行,一个人是寂寞的,这些天不仅是我忙,宝贝比我还忙,什么东西收拾,checklist,购买各种物品,都替我想的十分周到,我基本上就不用怎么操心了。谢谢宝贝!这次旅行真是多亏有你的支持和帮助!!

刚到公司,Mark请了第一顿饭,在一家意大利餐厅,和kevin,sagar聊起了很多中国和美国的不同。公司的环境还真的不错!照片等我整理之后发出!

Posted in 生活杂记 | Leave a Comment »

数码相机–Canon 910 IS

Posted by joychester on October 30, 2007

拖倪晓波同学在日本买了佳能最新款的数码相机,果真要比国内的行货便宜1000左右,回家用了一下,效果不错!!感谢倪同学:)这次如果能去美国的话,我就可以拍很多照片,分享给大家!!我的拍照技术还有待这次检验…….

今天去交了签证费,780,是便宜了20块,但是还是觉得很贵。。。。而且美国的拒签率仍居前几位,所以能不能签成功,真的要有些运气在,老天保佑!

Posted in 生活杂记 | Leave a Comment »

签证日期提前了–11/6

Posted by joychester on October 25, 2007

希望可以成功!!因为我没有任何移民倾向。。。。。外国始终是外国,家始终是家:)

Posted in 生活杂记 | Leave a Comment »

开源的文本比较工具-textdiff

Posted by joychester on October 22, 2007

Posted in 测试技术 | Leave a Comment »

Regular expression

Posted by joychester on October 22, 2007

工作中参数化经常用到,随便找了一个做备查,故贴之: http://www.phpe.net/articles/151.shtml

Posted in 测试技术 | Leave a Comment »

成功安装Loadrunner

Posted by joychester on October 16, 2007

这次安装正版的Loadrunner,还有点不太适应:)而且使用的是电子license,需要惠普进行配合生成永久的key,所以步骤要繁琐一些。

这次我采用的是contoller(Full install)+ remote load generator的结构,为了能尝试一下在局域网内,可以互相通信,进行分布式压力测试。

1.增加远程的load generator需要将远程的机器名完整的写进contoller,以便它可以在局域网中寻找。

2.将远程的load generator service 打开,并且保证开启agent的终端服务,这样才可以两端进行通信

3.如果没有防火墙的话,防火墙选项不要选择

Posted in 测试技术, 生活杂记 | Leave a Comment »

今天开始装loadrunner

Posted by joychester on October 11, 2007

今天开始装正版的loadrunner,说实话我真的不喜欢这个所谓的市场占有率第一的工具。。。。不知道为什么,虽然试用下来是很强–把许多方面的功能都集成于一体,但安装以及设置的繁琐,使得我渐渐失去些耐心。

而且对电子许可还不是很熟悉,客服的电话经常打不通,上海的客服热线居然是空号!!

不知道是怎么了,难道被收购的企业都会走向没落。。。。。。。

Posted in 测试技术, 生活杂记 | 1 Comment »

预约到了签证面谈时间,不过太晚了。。。

Posted by joychester on October 10, 2007

今天终于在打爆一张卡的情况下预约到了11月19号的签证时间,不过太晚了。。。。

没有一点可以高兴的原因,不过还是有点庆幸自己还是能约到的,希望奇迹可以发生!祈祷中

Posted in 生活杂记 | Leave a Comment »

Google performance testing also using open source!

Posted by joychester on October 9, 2007

网上关于Google公司进行性能测试的心得的视频是Goranka Bjedov在伦敦一次论坛中录下的,不过那么好的视频实在是声音太小,所以效果大打折扣。。。。。

不过今天在InfoQ上看到了她关于性能测试的帖子,仔细进行拜读,发现很多共鸣(哈哈),很高兴能和这位大师on the same page,lol

现在把他的文章概括如下:

what performance engineer usually feel:

1. fear :when the performance job is coming in

2.inadequacy: when we are not getting anything done

3.confusion:what should i do next

what performance testing should contain:

Speed- does the system respond quickly enough

capacity-is the infrustructure sized adequately

scalability-can the system grow to handle future volumes

stability-does the system behave correctly under load/for a long time

to do performance as a service:

she is more focus on service side and no worry about the client side behavior

she think that should be function QA’s work(this is a big difference between steven sounders and Bjedov or between Yahoo! and Google)

Can not do everything accurately, just 90% important information by applying 10% of total effort and time

There is no fixed answer on your performance, and we can not wait for everything to be clear, or spend long time to find what’s the relationship between each two or each three factors

Create benchmarks:

Got current usage pattern or user modeling of application,ideally

run the benchmark with different loads and investigate its behavior, including:

– Which transactions are taking most of time? (losing index)

– Which transactions seem to get progessively worse with increasing load?(create meeting, list page)

– Which transactions seem unstable (create meeting using same account)

– repeating testing until convinced I am observing real system behavior(consistently up?)

Create new benchmark with dev and run the benchmark every day

so we can find out the problem as soon as possible, ideally the next day

we can easily find a code change that has impacted performance in an unacceptable way

When find an issue that can not be explained or understand with performance tests

here comes the performance profiling and tuning activity

(you should learn to do isolation work, step by step)

Open source tools

Jmeter,Google is using, Me too:)

Monitoring your service during performance testing(Minimun SET)

CPU%

Memory/GC%/Heap graph

I/O utilization

Network utilization, eliminate your network factor as much as you can. It can make things easier.

In addition:

Exploratory performance testing in the future

mike kelly:They open a browser while a test is running and they see what the user experience is for them while the application is under load.

Posted in 测试技术 | Leave a Comment »