15 ms·
The logging framework isn't a bottleneck, and other lies your laptop tells you
- _bxg1 7y agoInteresting, but I'd think that just running your profiling in a server environment would have the same effect as doing everything in one, no? And for much less hassle
- Analemma_ 7y agoYou'd be amazed how few developers even know about profiling, or think it's a method of last resort when other attempts to track down performance issues have failed. One of my standard interview questions is, "A customer comes to you and says that [app] 'is slow', with no additional information". You look at the code and there are no glaring inefficiencies, no O(n!) algorithms, etc. What's your next step?", and less than a quarter of candidates ever mention profiling. "Sympathy for the hardware" is, IMO, sort of a hack to be an imperfect solution to this problem.
- Ididntdothis 7y agoI see the same . People will do anything to avoid using a profiler. It's really weird.
- deleted 7y ago[deleted]
- thaumasiotes 7y agoPeople will try to avoid using tools they aren't already using. You see the same thing with debuggers.
- javajosh 7y agoI also see this, and I think its worse than that because so many devs concentrate only on the static expression of the code and have little understanding of what things look like at runtime. Ironically, client-side coders are much better at this, thanks to excellent tools. Speaking of tools, server-side profiling is almost always weird and it pays to have someone show you the ropes. (Java has some of the best profiling tools, interestingly).
- scott00 7y agoIs profiling actually a good answer to that question? Profiling is very useful for improving the performance of software under a particular workload, but unless you have very good non-anonymized telemetry anything other than trying to get more information about the customer's situation is going to be a wild goose chase. I would definitely start with talking to the customer to get more details, and ideally observe the customer using the app before I got anywhere near a profiler.
- paranoidrobot 7y agoProfiling is really useful for any moderately complex application, particularly where you have dependencies upon a bunch of third party code. While your code may look all nice and sane, not have any glaring performance issues - what you may not realise is that you're using a framework that does things in unexpected ways. The devs I work with are running into the reality of this at the moment - they blame the servers/network/database/whatever as being slow/shit/etc. I go take a look and see that network traffic is at capacity. They've got some 'magic' caching framework that promises to speed things up by storing data in Redis. What's happening in the background though is that this caching framework is doing dumb things like asking for the same key over and over again - so we've got a multi-Gbit stream of the same handful of keys being asked for thousands of times a second. These are the sorts of things profiling can tell you just by looking at the amount of calls to Redis.
- deleted 7y ago[deleted]
- jeffbee 7y agoThe upside is if you know how to use the profiler, especially if you know a lot about PMUs and whatnot, you'll look like a damned wizard to many people.
- tehjoker 7y agoPMU = Performance Monitor Unit. Never heard of the term before. Thanks!
- bluedino 7y agoWe had a customer who complained about a part of our site being very slow, it drew a bunch of Canvas stuff back in like 2011. Eventually we got them online to do a screen share, and sure enough it took over a minute to render the page (it was a map). They were using an 8 year old CPU. Switching them from IE6 to Firefox fixed the issue.
- SilasX 7y agoI'm glad you didn't have to upgrade their hardware!
- bdcravens 7y agoHad a similar issue, but switching browsers wasn't an option. This was in a hospital environment in 2002: slow computers, running IE as the standard. A large form with a ton of HTML select dropdowns totally killed performance. Had to rewrite the thing to use just a few (dynamically generating options, before heavy Javascript apps were common), which fixed things.
- devonkim 7y agoThe reality is that a lot of profilers cause a sort of Heisenberg effect when running in production where it can slow down your code so much that it's not as meaningful anymore. This is now the time your ops engineers like me will be wagging their finger saying the application should have had instrumentation or APM support built-in like via OpenTracing or that ebpf and friends could be useful if your production machines were reasonably up to date. In most occasions I've seen, the majority of engineering teams outside massive scale companies with gobs of resources even today wind up debugging performance problems like it's 1999 with application-external hypotheses and checking for smoking guns like high page fault rates, dropped packets, etc. (eg. USE methodology).
- jeffbee 7y agoSampling cycle count or LBR with linux perf events is almost invisible to performance, maybe a 1% hit to throughput as a general rule. The problems come from languages where the PC is irrelevant, like Python, but nobody uses Python because it's fast, so using a python profiler like pyflame should be fine, even in production.
- devonkim 7y agoProfiling in production with the JVM using something like YourKit or JProfiler is the typical case for myself. Ironically, I've found profiling with Python in production easier for the reasons you've mentioned. If something is down or running slowly already, adding another 3%+ latency is hardly going to be an issue. Architecturally, with big monolithic programs that do too many things attaching a profiler to try to analyze 1% of the program's responsibilities or surface area becomes a risk to other production operations unfortunately. In most cases slowdowns happen because of resource saturation, things timing out, blocking on shared resources. In the first scenario, trying to run a profiler can exacerbate the problem or even fail to start, so the only way forensics can be done there is by emitting observability data prior to the failure point. Other approaches taken have been the more Erlang style "let it fail" methodology which is fine for newer projects but represents a rewrite for most systems in practice and is thus far, far beyond profiling discussions.
- 7y ago
- kasey_junk 7y agoFor performance centric uses you tend to run benchmarks and performance tests a lot. Having production quality hardware for the dev cycle is extremely valuable for these uses.
- cowsandmilk 7y agoSure, but my IDE doesn’t have be running there. Code compiles and is benchmarked on prod hardware (and OS environment), I write code on machine designed for my productivity.
- gav 7y agoPerformance testing is hugely valuable but nothing beats having performance metrics captured and made available from production. You never really know how things are going to perform until you see them under real load against real data. There’s been many times I’ve been bitten by this, including the one time we found that a small portion of users would set the number of results returned to the max and scroll through hundreds of pages of results, blowing the cache for everyone. I tend to hear “we run performance tests so we don’t get regressions” a lot more than “we monitor the performance of releases to canaries and rollback”. It shouldn’t be one or the other, both are invaluable.
- ColanR 7y ago> small portion of users would set the number of results returned to the max and scroll through hundreds of pages of results Yup, that sounds like me. I do exactly that whenever the pages are slow to load. Rather wait longer, once.
- _bxg1 7y agoI'm not saying remove it from the dev cycle; you can stand up a remote server for whatever testing happens during your normal workflow without a) buying a physical server box to use as your workstation, or b) constraining yourself to working via a terminal.
- bluedino 7y agoServers (especially VPS) can be incredibly inconsistent with performance
- julianeon 7y ago"It works on my machine" remains a problem to this day. While you can make various workarounds to rectify this, it still seems like "so make your machine the machine it runs on" is a very effective solution. Unlike the alternatives, once you commit to it, you can't forget or revert back to bad old patterns. I've had this thought before: What if Amazon, one day, just decreed that all employees' laptops had to run Amazon Linux? Maybe it's a good thing I'm not Jeff Bezos, but I think it would have a lot of positive effects.
- javajosh 7y agoThe OP is talking about hardware consistency between dev and prod, not OS consistency.
- cowsandmilk 7y agoWhy the focus on Amazon here? Why assume developers at Amazon don’t use Amazon Linux for development?
- sharpy 7y agoA lot of them do. In fact, laptop + cloud desktop that runs Amazon Linux is the standard set up now.
- deleted 7y ago[deleted]
- ex_amazon_sde 7y agoEx Amazon here: the development in Amazon is very different than many other companies. There is no Docker and every small change is deployed on test stages using a CD system. Most tests and experiments are done on servers.
- jbverschoor 7y agoConclusion, which you should already know: cloud providers offer obsolete hardware for a premium price
- Jgrubb 7y agoWrong conclusion, it's actually that people who build web applications and people who know how computers work are often not the same people.
- jbverschoor 7y agoThen why should you even allow them to access any server - vps or bare - at all? Also, please remove all ops-code from the two of someone who doesn’t understand ops is calling himself devops
- wmf 7y agoWe're not talking about obsolete hardware. There is a fundamental tradeoff between frequency and power efficiency and even the very newest servers generally choose a point on that tradeoff with more cores at lower frequency. There are also scale effects where you can put a small amount of very fast NVMe storage in a laptop without much of a price premium but to store all your production data on NVMe is possible but might not be financially justifiable.
- PeterStuer 7y agoGiving each developer access to a full mirror of the production environment might also not be financially viable. If a production scoped database fits on a small ssd, then your deployed production dB should probably not be on spinning metal trying to mitigate the orders of magnitude performance hit with boatload of expensive ram. If it doesn't fit, then obviously you have plentiful other issues that should be screaming at you that your laptop performance profiling is not going to make much sense.
- fmakunbound 7y agoMany years I worked with a team that couldn't figure out why the code ran so fast on Bob's laptop but was slow as shit on production server hardware. The production hardware was state of the art at the time and they were kind of in a pinch deadline-wise. They ended up literally deploying Bob's laptop to the ISP data center.
- duxup 7y ago>They ended up literally deploying Bob's laptop to the ISP data center. I guess in a pinch but that is a solution that I just don't think I would like.... I would feel like we're going to figure this out, not surrender to the absurd...
- throwawaywrench 7y agoI doubt it was a solution anyone liked.
- billyhoffman 7y agoEspecially Bob
- lmm 7y agoBob probably got a newer-model replacement and was fine with that.
- Rapzid 7y agoThey probably made Bob develop on the server..
- ComodoHacker 7y ago..until he gets matched performance.
- 7y ago
- duxup 7y agoI remember when I was building my first PC with some friends doing the same. One managed to get a hold of a 'server' and we just assumed it had to be fast right? Very much learned the opposite....and the lack of a sound card was a big turn off...
- userbinator 7y agoFor server workloads, it often makes sense to give up clock frequency to “fit” more cores in the same heat / power space. In other words, server hardware is usually designed for parallelism/maximum throughput, while client hardware is designed for single-threaded performance and decreasing latency.
- deleted 7y ago[deleted]
- qubex 7y agoTo rehash the old and tired metaphor: one’s a sprinter carrying a baton and the other’s a herd of marathon runners dragging a sled.
- abstractbarista 7y agoThis is brilliant and I love it.
- gumby 7y agoThis is grossly under appreciated. And this is why server machines and sustained performance remain one of Intel’s strengths, and despite the number of ARM developers out there, ARM hasn’t managed more than a toehold in the server market. Nobody has designed an ARM CPU for that kind of workload. Intel hardly has an impregnable lead in this regard, but I expect AMD to get noticeable server market share before any ARM part does.
- bdcravens 7y agoWorried that your laptop is too fast? Run your code in Docker for Mac, that'll fix the problem.
- Rapzid 7y agom.2 (NVMe) is so fast and cheap it's absurd. I blinked(a few years) on hardware and when I went shopping for a new disk was blown away by the price to performance. I was equally as shocked to discover the crap-show that is the m.2 controller space. I felt for sure supermicro would have chassis you could load up with those suckers and they'd be hot-swappable and changing the face of storage. Instead I found proprietary(Intel/AMD) RAID drivers coupled to specific CPU models and expansion cards that could take a measly 4 drives(no hot-swapp).
- wmf 7y agoEDSFF is kind of a hot-swap flavor of M.2 but it has taken years to get to market and has bifurcated into three incompatible variants. For example, here's what you're looking for: https://www.supermicro.com/en/products/system/1U/1029/SSG-1029P-NES32R.cfm https://www.supermicro.com/en/products/system/1U/1029/SSG-10...
- jlgaddis 7y ago128 TB in 1U of space. Damn.
- simcop2387 7y agoThe hotswap is unfortunate, and likely a resukt of server/consumer space differentiation among all kinds of vendors (os, cpu, motherboar, and even the nvme manufacturers all have to play along). But the limit of 4 is at least a real technical limitation, each one of those addin cards usess a pcie 16x slot (either real or "dimm.2" ) and each card needs A 4x from it. You could use a mux to add more but they're already getting to the point of being able to saturate the links. Pcie 4.0 and 5.0 will give a lot of headroom for more drives on a system.
- derefr 7y agoSounds like we might need to go back to the kind of mainframe architecture that has IO offload. Split the PCIe bus into NUMA-like zones; give each zone its own (probably ARM) CPU, running its own kernel; then use "application processors" (probably x86) to command-and-control the IO zones, allocating e.g. IOMMU-subvirtualized ethernet channels to them. Control plane/data plane separation.
- vmception 7y agoI synced an Ethereum fullnode on one of Linode's most powerful instances, it was fast but seemed like it should be faster. I was posting issues on github about how this wasn't working fast enough a lot of tutorials online is about people trying to get their raspberri pi to sync blockchains, so I was prepared for the worst but then I put together an 8 year old desktop and it synced in 2 days kind of underwhelmed at "cloud" options. but they work
- godot 7y agoThe article talks about the difference between laptop vs server, but no other comments here so far have really touched on that topic. I think this post isn't about how good or bad cloud/VPS servers are, but really about difference between running on laptop vs servers. It seems starting around maybe 2012~13, devs in the tech industry started moving from Windows laptops to Macbooks in large scale, and this was when it became much more common to run your server stack locally on the laptop. This was really strange to me at first; since prior to this, I was very used to having "dev servers". I came from LAMP world where we'd write code on Windows, upload code to a dev server, run the app on it and test. This seems very amateur in retrospect, but I also worked in a relatively large unicorn at the time (from 2008 to 2013) and I don't think we were even the only company doing that -- from what I knew, this was pretty much standard practice, especially if you run LAMP stack. Which is to say, it was way more common back in the days to dev on a dev server than on their own laptop. (Maybe that's a point against Windows at the time; about how difficult it was to have a reasonable local dev environment on Windows.) So when I joined a startup later, and found out how everyone on the team had Macbooks (with no option of going Windows), and everyone ran the entire server app on their laptops (and this was the nodejs world, no longer LAMP), I was almost in disbelief -- are we not to worry about any difference between developing, testing and running this server code on a Mac laptop, vs when deploying it and have it actually run on a Linux server later? After a short while it seemed like it was not really a concern; it seems perhaps either macOS linux is close enough to servers, or node is compatible/high-level enough between mac and linux. Reading this article is kind of a wake-up call -- no, it's really not exactly the same.
- wmf 7y agoAnother thing is that if you're using Node.js (or worse, Ruby or Python), your code is so inefficient that you probably don't care about performance differences; just throw more dynos at it.
- jinglebells 7y agoIsn't that the argument for Node or Python? You can get a damn powerful VM for the same monthly cost as 1 developer day?
- speedgoose 7y agoIt's a bit obvious that some major cloud providers are very expensive when consumer hardware provided so much better performances compared to price for years. But they can have such a pricing model. What they offer is good and valuable anyway. And you need to pay Jeff Bezos.
- senderista 7y agoLOL "the mechanical sympathy community" Good article though. I'm sick of seeing comparative benchmarks on a MacBook. If you don't have real servers you should always benchmark your code in the cloud (bare metal instances if you can afford them).
- saurik 7y agoWell, you should benchmark on similar setups to what you will deploy on: benchmarking on "real servers" or "bare metal instances" is also going to be highly misinformative if you expect most of your deployments to be on virtualized hardware under KVM or Xen.
- xxs 7y agobenchmark on a thermal limited, turbo-boost enabled machine is usually a very bad idea. (single socket, etc.) Edit: If you wish to microbenchmark - lock the CPU frequencies (core/uncore for intel), lock the voltage too and measure the power draw as well. You wish to use taskset too, depending how many cores the benchmark utilizes.
- sdflhasjd 7y agoWe've had software perform wildly different on our dev servers from prod servers (which are owned by customers). One time it was VM overprovisioning, another time we were just getting completely different performance depending on what hypervisor was being used.
- qubex 7y agoGood article, but one thing that annoys me deeply is the author’s intimation that a server ‘renders’ a web-page. A server does not ‘render’ a web-page, that’s a client-side (browser) task (unless he’s referring to running a browser in a Remote Desktop environment, which seems to be definitely not the case).
- orisho 7y agoRender is the term used by many templating languages to denote transforming a template to a result using parameters. So in the case of web apps that use templates, it's the terminology commonly used (you could argue about its correctness, but it is this word). For example, the jinja2 library names the transform function 'render'.
- qubex 7y ago> you could argue about its correctness Yes, I do. But as you say, it’s in circulation. I guess I dislike it in the same way that I consider ‘literally’ and ‘figuratively’ to be antonyms, but how the former has unfortunately come to be considered a synonym of the latter, which basically hobbles the language permanently.
- orisho 7y agoYes, that one is definitely very unfortunate :(
- qubex 7y agoI literally hate it. ;)
- simiones 7y agoWho considers "literally" to be a synonym for "figuratively"? I would venture that almost no one. In fact, it is used exactly for its proper meaning, as a hyperbole. If I say "I feel so embarrassed I could literally die", I am using literally in its proper sense, but hyperbolically. Just like if I say someone was "a mountain of a man" I am using the proper sense of "mountain", even though the man is not literally a mountain.
- throwaway_pdp09 7y agoSeems a bit naive. "Hanging out in the old data center, rendering web pages for a thousand people simultaneously? A different story. For server workloads, it often makes sense to give up clock frequency to “fit” more cores in the same heat / power space." Servers have larger caches, I'd expect better IPC than a laptop CPU from better micorarchitecture, at least double the memory channels etc. I guess that was his point though.
- zokier 7y ago> Servers have larger caches, I'd expect better IPC than a laptop CPU from better micorarchitecture, at least double the memory channels etc. In aggregate yes the server cpu numbers are great. But looking at them per core makes them much worse. I checked some random Xeon Platinum CPU vs a mobile i7, both being Skylake (so essentially same microarch). The Xeon had 28 cores, 38.5M cache (=1.4M/core) and 6 memory channels(=0.2/core). In comparison the i7 had 4 cores, 8M cache (=2M/core) and 2 memory channels (0.5/core). The Xeon uses 25% faster memory, but that doesn't really make up the difference.
- throwaway_pdp09 7y agoMy understanding is kind of matches yours, but I assume it will depend. If you have a memory-bound problem then yes I'd expect a laptop perhaps to be competitive, but if it substantially hits cache for the server then the laptop with smaller cache, may be waiting longer. > But looking at [the server cpu numbers] per core makes them much worse but for what benchmark? (sorry if you said and I missed it)
- inetknght 7y agoIf you have a memory-bound problem running on a Xeon with a couple dozen cores... you either have a couple dozen memory-bound problems (which brings into scope the cache per core concept) or you're using the CPU wrong.
- bitcharmer 7y agoI come from a field where it would be unthinkable to draw conclusions about application performance by running it on a developer's laptop instead of the target platform. Judging by the comments here this is not as obvious as I previously thought.
- pdimitar 7y agoMost businesses will never allow you to actually develop and test, for a full day (or weeks on end), on a dedicated server machine. It's about costs.
- tyingq 7y agoThere's also the similar problem where a developer usually has a much better laptop, phone, internet or lte connection, etc, than the average end user.
- ChrisRR 7y agoAnd the equally valid problem when the developers have more intelligence than the average end user. I've seen so many developers who can't understand that the average user isn't going to spend hours clicking through menus to find what they want.
- draw_down 7y agoThat doesn’t sound like a situation where the developer is the more intelligent one.
- Yizahi 7y agoI remember the Youtube dev story posted here. They optimized Youtube page at some point, deployed and saw much worse average load time for users. As it turned out the whole new batch of users saw load time decrease from unusable tens of seconds or minutes on slow connections to tolerable less than 10-20 seconds or so and they started using the site which dropped average time by a lot :) All these modern developers usually ignore how their websites overloaded with usually unneeded scripts and trackers load on slow networks and PCs.
- bcrosby95 7y ago> All these modern developers usually ignore how their websites overloaded with usually unneeded scripts and trackers load on slow networks and PCs. Both Firefox and Chrome developer tools even have settings for throttling network speed. I wonder how many developers use them.
- dataflow 7y agoA bit off-topic, but can someone tell me why server firmware takes so long to initialize compared to laptop firmware? And why even laptop firmware takes longer to initialize now compared to laptops from some say 7 years ago? Why is firmware initialization getting so darn slow when computers are getting faster?
- fennecfoxen 7y agoServers never reboot, so no one cares.
- fomine3 7y agoIt could be a reason. Maybe Server's boot time is not optimized like Microsoft/Intel does in PC.
- yjftsjthsd-h 7y agoI have no idea why you're getting downvoted; this is very much my experience. An actual physical server is usually either a database server that can literally manage years of up time (no I didn't like it, but they were on an isolated network and the Oracle DBAs were very particular about updates), or else VM hosts that support live migration so nobody cares if we happen to have one host offline for an hour or two while it's patched and rebooted.
- theandrewbailey 7y agoServers really need to make sure that everything works, and works properly.
- bjonnh 7y agoMemory initialization is really slow. On servers there is that, plus the fact that you usually don't want to do a fast ram check like you can afford on a laptop. Add to that initialization of the remote management, SAS/raid,... A server does a pretty thorough quality control when it boots. Also if you have a lot of mechanical drives, there may not be enough power budget to spin them all up at the same time, so they start progressively.
- 7y ago
- ineedasername 7y agoI have two computers at work: A Xeon workstation that was low-mid range when new, 7 years ago, and still has an HDD. And I have new mid-range i5 laptop with an SSD. The old Xeon performs much better for everything except boot time. Even program load times.
- Thaxll 7y agoThe main error here is to let people loadtest on their own machine, you should always to do that on the same platform that will run in production. I think the article is missing many key elements, for example you should always trottle your CPU when doing benchmark.