The .NET on AWS Show, featuring Lea Mladineo!
In this episode we are joined by Lea Mladinaeo, Software Engineer at FundApps! Join us as we learn about Green Software Engineering and how it can save us money!
Brandon Minnick
Amazon Employee
Published Jul 1, 2024
Last Modified Jul 18, 2024
Loading...
Brandon Minnick 1:07
Hello, everybody and welcome back to another dotnet on AWS show. My name is Brandon Minnick. And with me today, we are joined by two very special guests. One is guest co hosting with us. You've seen him before on the show. You know him you love him. Martin Thwaites. Welcome. Oh,
Martin Thwaites 1:28
I'm here again by unpopular demand.
Brandon Minnick 1:34
absolutely not true. It for regular fans of the show, you know, we are usually joined by Francois Bucha. Rose, she couldn't make it this week. He's out amongst the people. He's at a speaking at a conference this week. So if you see him out there, tell him we said hi. Tell him we miss him. Tell him we love him. But Martin's joined us on multiple dotnet. And maybe we have chosen the past. I think, in fact, You are our guest last week, if I remember correctly. So two weeks ago better to have back then our fan favorite. How are you? How was your week?
Martin Thwaites 2:09
I am I am really good. And speaking at conferences. That was That was mean you last week. Over in over in Oslo. That was Yeah, recovering. recovering from a long week of conferencing. And I like the term conferencing because it covers a manner of all sins. But it was an amazing, amazing experience during a couple of conferences, talking about all the awesome things around open telemetry. And for ones. I actually didn't talk about dotnet in any of my conference talks, which was a little bit weird. So but yeah, it was it was really cool. I think you you enjoyed yourself as well over in Oslo.
Brandon Minnick 2:54
Yeah, yeah, absolutely. You know, it's a little bit farther for me to get to. I come all the way from California to Oslo. But yeah, it's one of my favorite conferences of the year, and I highly hadn't recommended for anybody remotely in the area. If you can fly within reason to NDC Oslo next year, go do it. It's one of the biggest one of the best dotnet conferences in the world. And in my opinion, and it was just so great. You know, Martin Martin I were talking about before the show, just all the the focus and what's the word I'm looking for kind of the feeling the buzz there we go about dotnet despite at NDC, Oslo. And I think it both for me, very biased working at AWS been doing a lot with dotnet fire on AWS, making sure we had support for AWS hosting before dotnet. Aspire went live, which we do, which we did. Mission accomplished. And it doesn't go unnoticed. We actually had the VP of Azure developer experience Scott Hunter, good friend of mine from when I used to work at Microsoft. Scott used to be the VP of the dotnet team. And in his keynote Friday morning, he highlighted how awesome it is that down this fire has both Azure and AWS support. He poked Google a little bit which is Google's data team but add support. But yeah, truly just incredible conference incredible community incredible event. absolutely worth it. You learn so much. You get to be around amazing people. What did i What did I miss?
Martin Thwaites 4:44
When you talk about the people? I think the thing that I get out of conferencing is the attendees. And I think I had an amazing week talking to attendees in Amsterdam and Oslo and Just the I mean, for me, it's The Buzzaround opentelemetry. And people like actually starting to, to get in this world of thinking about what things are in production, like thinking about how things work, thinking about not just, oh, it works, I'll ship it, thinking about how do I see these things and the questions that you get from people? And the comments after the talks have, I didn't think about it like that. Oh, that's interesting. And the best one for me was when people suddenly came to me afterwards and said, Well, it would be absolutely great. All this is stuff that I can take into my job on Monday, you know, the real tangible stuff. And that, that's really cool. I really enjoy hearing all of that stuff.
Brandon Minnick 5:49
Yeah. I said something similar. Steve Gordon gave an amazing talk about dotnet performance and how to use things like reef pools and benchmarking your code. And I spoke with them after and obviously thanked him it was it's an amazing talk. I was like, Man, I am so excited to go back and write code now. Like, you just gave me so much more work that I wanted to know, now that I knew all this, like, I I've got to add it to the backlog. And so it's yeah, it's one of those good problems to have, right? Where you're just excited, it makes you want to jump right back on your computer and start coding again, whether it's a work project or a fun projects. And that's, I think, was my favorite thing about conferences,
Martin Thwaites 6:34
the inspiration, isn't it? You know, and I, that's what I like to do in my talks is I don't see this as a, you know, I will talk through how to implement open telemetry and all of that kind of stuff. But I don't expect people to sit there and take pictures, and then think, Oh, well, he said, I should do it this way. We'll go back and watch the video later. You know, people will watch this on YouTube and all of that kind of stuff in the room. Now, the reason why going to conferences, so much better than watching the talks on YouTube, is that inspiration is that motivation, the the energizing of, you know, the the amount of people when you walk around a conference and you see them like sat on their laptop, on one of the desks with their food, like trying something out that was just in a talk before. I love it. I love it. But yeah, they aspire thing. I think there was like eight, I think talks out of that 100 that were about a spire. I don't remember whether there was a specific as AWS one. But there was loads of talks that were using it, there was loads of talks that were even just using it tangentially to their talk. So I'm hoping that you know, all the dotnet people start going, how can I use it? Whether that's just the dashboard, which is the thing I think is most amazing about a spire, whether it's just that or whether it is some of the other tools like service discovery, and resiliency and all of those other things, then great, but just thinking about how they can use it. So yeah, I think, I think what was this moment, maybe the sixth episode, you've mentioned Aspire?
Brandon Minnick 8:15
Like is this? We're just going to change the name to the dotnet Aspire show. Really, yeah, we were fortunate to have David Fowler on episode, about a month, month back and alongside norm Johansen, who's our lead down and engineer on the den of SDKs. And, yeah, we're, we love it here internally. We talked about it every time we get together in our dotnet. We call it the dotnet language advisory board every month. So we're excited about it. We hope everybody else has done their communities excited about it. And you can try out the Intuos hosting support for dotnet Aspire today, we'll take your feedback, we've also got a CDK or a pull request open for dotnet fire to add CDK support. So it's, it's only going to get better from here. But Martin, we have such an amazing guest today. And speaking at conferences, you've probably seen her if you've been to any of the other NDC conferences, I believe she'll be it and you see Porto coming up. She's a software engineer over a decade of experience working with Dev net, currently working at fun to apps in London. Liam Montevideo, welcome to the show.
Lea Mladineo 9:30
Thank you very much. She made me feel very female now talking about NDC Oslo and me not being there. Like yeah, thank you for having me.
Brandon Minnick 9:44
Absolutely. I let So for folks who maybe you haven't met yet, who are you in? What do you do?
Lea Mladineo 9:51
Um, I'm a software engineer. I mostly work in C Sharp. If I get a chance to code these days That's that's mostly it. Yeah, I met both of you at NDC. Well, Porto and then London, talking about a re architecting, our software here in Fundex, which then also made me think about sustainable development that you're going to talk about today.
Brandon Minnick 10:23
Yeah, and thanks so much for for joining us, you know, sustainability, green software engineering, it's, it's certainly been, I see it all the time in the news lately, if you go on anywhere, Twitter, Reddit, peruse the internet, people will be talking about it. But I think mostly in terms of what we're seeing around like AI, crypto datacenters, using massive amounts of what we're talking about, like fusion energy reactors needed for so what is green energy? What is sustainability?
Lea Mladineo 11:01
Well, if you look at it from a software point of view, because I assume most of us here are listening. And both of you are software engineers. Green software is a software that causes minimal emissions of carbon, when it runs. The good thing is, it goes hand in hand, having co benefits of what we already want from our software, making it reliable, resilient, cheaper, more performant, more secure, it doesn't need to be that additional thing that we need to think about that we need to learn that we need to do with our software. It really goes nicely by making it reliable as cheaper performant. And secure it also we are making a greener if you're using the services properly. And if you're just thinking about it, I think that's that's really
Martin Thwaites 11:58
an interesting way to think about it, that the cost that we pay for servers for compute for that kind of stuff, is what we're paying for the power, we're paying for those things that are not anti green, but the things that use those resources. If we pay for less of that software, pay for less of that power, less of that compute, then we are helping save the environment by not paying for as much compute. So how do we do that we'll make it faster, make it more efficient, make your code more efficient. So actually, you're, it feels like they're all the same thing.
Lea Mladineo 12:38
That they are, I mean, I'll assume that most of the people listening are already using AWS, and keep doing it like, well, cloud providers and hyper scalars. It's probably one of the easiest things that we can do. Because it's not just also the energy that our software users. It's also the hardware, it needs to be produced in some way. So that embodied carbon, and if I have something on prem, is just serving me to do something, when we have this in hyperscalers. When we have it in AWS, it's like it's making them profit more, if they're making a good use of it, if they are making it work harder to bring the money, it's making it cheaper, but it's going to also make it cheaper for us. And it's going to do it, like make it greener for the environment. I mean, I would just want to take a step back here, just to kind of like, maybe think a little bit why we are even talking about this. I mean, you know, why do we even care about the green software? I think it's enough to kind of say that what we have here on climate, what's happening to the world. Of course, we are not the biggest contributor being software engineers and running software and using this hardware. You're not the biggest contributors, but we are still contributors and and we can make something to be able to live on this planet in years to come. I mean, we already see that it's a bit more difficult than than it used to be. The weather here in London being a little bit, you know, sunny and rainy. And, you know, I will not like I've no complain being in London. It's delightful compared to other places.
Martin Thwaites 14:32
We invented the rain. Fire.
Brandon Minnick 14:37
Yeah, oh, even you know, here I'm in Northern California. And we have a big problem with wildfires and they get worse every year as the average temperature of the planet continues to increase. We see less rain. We get more wildfires. And literally last night, we had a beautiful day windows doors open and then In one point, my wife buckets, he smokes kind of smoky wonder what's like, like, is it neighbor Barbecuing is Father's Day, so, but sure enough, we looked it up and there's a fire couple miles north of us and it's only 20% contained, which means it's just gonna get worse. And that's how life is here now we have wildfire season like some places have like tornado season and hurricane season and we get wildfire seasons all because we're collectively contributing to the warming of the planet. But you mentioned something a minute ago that I even struck me even as you were hanging out chatting about chatting before the show about what we're going to talk about. And but until you said just now, the hardware, the hardware that our code runs up, that has to be produced that has to be machine that has to be a super mind. Tell me more about this, because I don't think I've ever heard that as a part of the discussion. Usually, it's what we need to have air conditioning in the data centers to keep it cool. But before the datacenter even exists, we're already impacting the environment.
Lea Mladineo 16:13
Yeah, and it's not just the the hardware that we use in data centers or on prem, it's also our phones, right? Like us changing our where is it always changing our phones every two years. So the majority of the carbon that we released into the atmosphere, it is through producing software or producing hardware, making it be harder that we can run something on. So by us, making that hardware work harder, or working on device, longevity, making our films be used for longer time, it is very important. Because if I take a look like there was a research that luckily, since I talked in Porto and London about this book was released, building green software, which I read after we decided to talk about this, I was like, Oh, this made my life easier. Let me just read about in one place. So I read there, the research was done, that actually the biggest contributor to all of this that we're producing is when the hardware is being built. So Brendan, you mentioned last time that you're building mobile apps, one of the biggest things that we can do is make our apps be supportable by older versions of phones, or really releasing security patches to older versions of phones as well. So you're not incentivized to change your phone every two years. And as well, I said that using cloud providers, like AWS, like they will make a good use of hardware, because they're going to make it work really hard to then kind of like balance that, that they need to buy this hardware that embodied carbon, and then make use to produce some value, which I don't think we can say for if we have an on prem or a small cloud provider, unfortunately. And the
Martin Thwaites 18:24
thing is that those resources, the classes serve as a resource, the reason why they've got a vested interest in making that hardware last longer in the data center, because money, you know, is something that I believe most businesses like, Yeah, I think. So. What's making that cost lower is definitely in their best interest. I remember, I can't remember who said it, it might have just been something that I made up does sometimes happen. But the, if you're running an EC two instance, in AWS and you're running at 10% CPU, essentially, you're giving 90% of your money to AWS for nothing. We should be looking at running our instances at higher utilization rates. It's one of the reasons why Kubernetes is actually useful. I hate Kubernetes. I've been very vocal about that. The reason why it's really useful has been packin is adding say 15 services on one server and utilizing all the CPU that's available up to a certain obviously, auto scaling thresholds. But that is really important because we want to utilize as much as humanly possible on all of these servers and AWS is going to make sure that the utilization is way more than we can do. Because think about the Kubernetes on a massive scale, that we're able They're able to say, Oh, we've got a billion workloads, how do we make use best use of all of this hardware that we've got. And you know, we just don't get to do that if you've got a 10 servers in your back room that are running all this stuff, because while you've got 10 servers, and that's how much you've got.
Lea Mladineo 20:16
Yeah, and I mean, that just nicely said, right, I ended, we think by using AWS, by using managed services by using ECS. By using lambdas. As well, we are just giving that hard work to AWS to optimize because again, money, if they optimize it, they're making it cheaper. For them, they're earning more money by making it more efficient, by stacking a lot more on the same hardware by making it work. Like solving that under utilization, which is like if you have an easy to instance, you are the one that needs to make sure that you're utilizing it, the best you can do that you are managing that energy, you're paying all of the cost. Whereas it's like, let's say, if you have lamda, you're just like I want to run this is going to take as long as I need it to take, then it's going to shut down. I don't care if it's going how someone spins it up how someone spins it down, you know, like it makes our job a lot easier.
Martin Thwaites 21:24
So I want to be clear here,
Brandon Minnick 21:25
that's why it's my favorite.
Martin Thwaites 21:32
I want to be clear that we're saying that by helping AWS more money, make more money, we're helping the environment. I don't like the sound of that. Well, I
Lea Mladineo 21:39
don't think we need to like this.
I mean, like there are incentives. I mean, you are incentivized with AWS person, Representative friends, that, you know, like that you make profit in this instance, I mean, it, we're not helping little guys, but this is about the environment, right. And, unfortunately, we are making it better for environment, if you're using AWS or other cloud providers, you know, make these things more efficient. Because to be quite honest, I don't want to spend my time on figuring out how to shift that work and demand and how to optimize my services. I want to bring value to front of clients, I don't care how do I spin up a service? Or how do I spin it down or, like, even with auto scaling, like, I don't want to spend time on it. And then an interesting thing, like, I'm kind of like what struck me like, I always considered myself as someone who cares about the environment. And then you know, like, you go to shops, you don't buy too much clothes, you don't order too much stuff that you will not need, you know, you're being mindful all of that. And then you figure out later on that everything that you're doing is useless because you're not having any impact. And by actually optimizing the current software services that are used by so many users is much more efficient, impactful. So pushing AWS to optimize those, it's much more efficient than me sitting down and starting using C to code because like, it just kills our developer experience, right? Like all users use it well. So I have my for each loops and methods and functions, whatever. And then I leave it to Microsoft to build a really good compiler that will optimize whatever I have written in nice dotnet. Lang, it's C sharp that I can understand. But I don't need to spend five hours trying to understand the code. And then let these big guys optimize that for us, because it will have much bigger effect than me sitting there and spending the day trying to figure out how to write something. Writing C. I don't know some modern language.
Martin Thwaites 24:14
I mean, you can write bad code, you can write inefficient code in any language. And using the language that's most important for you with a an ecosystem that backs that language with something like you say that we'll do a compiler that will build a CLR that's really, really optimized that can build an IoT framework that makes things massively optimized like date, Microsoft and making those investments so that we don't have to, we can, and I've done this before you can drop into unsafe in C Sharp and you can write more efficient code. In very, very small scenarios like very really narrow scenarios. You can write more efficient code by going lower. I mean ultimately, like you say it would be better for was all to write assembler. And you know, write everything is possible optimization level. But I can tell you that if I wrote an assembler way less efficient than writing it in C Sharp and take me way longer. So it's just not efficient, you got to find that equilibrium. And I like that idea that we're, we're trying to find like that equilibrium. And it doesn't matter really what language you're writing unless you don't write in dotnet, because then you're wrong. But if you write it, that is going to be constantly optimizing on the back end. We write code for compute, we write code for humans, compiler is what takes that code that we wrote for humans and makes that work for the systems. And we want that to be the most efficient that we can be. And that's how we can optimize. But then there's a whole level below that we delegate that shared responsibility model, we delegate the rest onto our cloud providers to do the rest.
Lea Mladineo 25:59
Exactly cloud providers framework. This book, I mean, what you just said, like well, writing assembly, and C and bow was a de like, what 40, or even maybe 30 years ago, we had very few people who knew how to write code very efficiently, because they needed to, like harder was not there that you can just write an optimized code, you couldn't shift, you couldn't do that many calls, you need to make it very efficient. And there are reasons why we would need to do it now. But most of us are not building, you know, I don't know dotnet, eight, like, you know, we're just using it to build some applications that bring value to our clients. So we will still need some of those specialized people and assembly and see and all that. But as you said, it needs to be it, the tool needs to fit the job that is trying to do. And me trying to use C to Bill help financial institutions, you be compliant with regulation. Honestly, it wouldn't be the best fit. So I use dotnet. And let Microsoft optimize the code, and then let AWS to run that nicely and managed and use less energy, of course, by me using the services that kind of make, make it fit for what I need.
Martin Thwaites 27:29
So what have you seen from dotnet? And the recent versions, the newer versions that have had a positive impact on maybe how many servers you can run? Or how quickly your lambdas run? What as there's been like a notable increase that you've seen in the throughput or the reduction in the response times that kind of stuff? And how has that had an impact on your stuff?
Lea Mladineo 27:56
The worst person in front of so talk about that. I need to stop that to make it work someone else if it's needed to make it optional. I mean, even now, with with release of dotnet, eight, I can't say the speaker specifics, but just release of dotnet. Eight is making these things faster. I mean, we had some trouble recently with, you know, we kind of tried to upgrade to use dotnet, eight and and then also, you know, we're a little bit stuck on garbage collection, which made us need to use more memory and stuff on ECS and fargate containers. But yeah, so I can't really speak specifically for dotnet age or what was built in in that system. I just use it because it increases our developer experience. I know how to get the logic out, I'd know how to get the value out to the client. And then I just as I said, leave it to the compiler to make it efficient. Because it's not about milliseconds, or you know, it doesn't need to be ultra ultra fast. For any of those operations. People don't need it immediately. Usually,
Brandon Minnick 29:09
that's good point. So if we've certainly been talking about everything on a high level, and I think we can, we can all agree that we can we can all do better to make the planet a better place for our children's generation and their children's generation. But later, we're where do we start?
Lea Mladineo 29:34
Excellent question. If you're not on Cloud beyond cloud, that's the first thing because then someone else is going to make that hardware work for you. That's, that's where you start. Start using cloud providers. And when you're shifting back, probably wanting like shifting one to one. It's a first step but you don't want to leave it there because you don't want to still run it in Easy to instance, a virtual machine that is always on and running. And being underutilized. It's exactly what we had, we kind of shared between the services, and so on and so on. But it's not where you want to stop. So probably the most, again, depends where you are in your business and you know, green awareness, culture and all that. It's that operational efficiency. It's, you know, cutting down the idleness of our services, killing the services that we don't use, you know, multi tenancy using lambdas, good ops, practices, Spot Instances, all of that. But probably where you start is like, you look at the system, you measure, you get some data, you figure out which service your clients or is used the most. So by making a change on that service, you're going to get the most impact. So if service is used by one person, or an app is used by one person, who cares, really, that's not going to save the world, it really won't. But if you take a look, maybe if you haven't even started, take a look at the cost, what is the service that is costing you the most money, it's probably a good proxy, if you're just starting out. And then later on, if you're a bit further in your journey, you might be looking at the energy. But then with these kinds of things, it's still hard to get how much energy your service is using, because we don't have the data. And then if you're like way further down the line, you'll be looking at carbon emissions, which we still don't have, which we want AWS to give us so we can make informed decisions, instead of these kind of like using the proxies of, you know, cost or energy. But yeah, looking at the data, and deciding what is the thing that is used the most. That's where I would start.
Brandon Minnick 32:06
Yeah, I think we're very fortunate. Martin, have you here today, with observability? Metrics, tracing, being your specialty? What, what tools? Do we have around getting this kind of information? Because I can see tracing for my app? But how could I either interpret that or does exist on a hardware level? To get this kind of information? There
Martin Thwaites 32:35
is there is a lot of tools that are doing this kind of stuff, but I think the biggest proxy is cost. Because if you pay less, you're using less. And, uh, like, where do you start level? Well, have a look at cost? Have a look at are your costs spiraling and going up? Are they coming down? Like that's the macro level? You know, once you've started looking at that, then you can start saying, Well, is there a more efficient way to do some of my code? So looking at infrastructure metrics, and I'm talking about infrastructure metrics, not application metrics. So infrastructure metrics, like, how much how much time is it taking me to run these lambdas, one of the counterintuitive things that we found out recently was increasing the size of lambdas, makes them run faster, because of the different call. So if you increase the size of a lambda, then you've got two cores to work with sometimes, and all of that kind of stuff can really help. And it can actually make it run faster. Now, the question then becomes, is that more efficient from a carbon perspective, from a from that kind of perspective? Potentially, I don't know. I know AWS is doing a lot to surface, those kind of metrics, because a honeycomb, we're really conscious about that kind of stuff. And we work on, we moved over to grab us on to make that more efficient. And that gave us a massive efficiency boost. We've got tons of blog posts about how we did that, and why that gave us some boosts. And you know, AWS are making strides in that area. So you know, get started by looking at Can I run on arm? Can I run these lambdas on arm? Can I run my easy two instances on arm? Can I run my AMI Eks cluster? Can I run that on arm? You know arm in general is going to give you performance boosts. So you just need to keep looking at it. And I think this is the thing that most people don't do is they'll deliver code. And then they'll push it over the wall and say it works. And they'll look at the response times and go yet Great. Nobody's complaining Whoo, that's got it.
Brandon Minnick 34:45
But if nobody's complaining, yeah, that is a happy day.
Martin Thwaites 34:50
Nobody's complaining louder usually the case. everybody complains, it's just they complain loud enough that I care about them. So That's that what I see most people doing is not actively locking. They wait for some notification, they wait for people to care. And I think when you think about your application, if you're thinking about doesn't have to be infrastructure metrics, it might be looking at your trace data and making that trace more efficient. But choosing those big things, those big ticket items, like they're the ones that are the I may be able to say that here's a five second trace, that happens 10 times a day. And I can get that five second trace down to a second. Is that the thing I should be looking at? Or should I be looking at the one second trace, that I can get down to 900 milliseconds. But it happens 10,000 times a day. Now, that's actually going to save me more money, it's going to make me more efficient, it's going to make me use less resources, you may be looking at something that says I've got some spiky workloads, that I'm currently running an ECS instance 20 474. Maybe the better option is to see whether I can move that to lambda. But look at that thing and say, Is this a spiky load? Like really asking those in depth questions? Like, can I distribute this and say, Yeah, I might want my spike Enos to be on Spot Instances, as like I said, you know, that, that might be something that you want to do, because Spot Instances are more efficient from a cost perspective, and obviously, from a perspective of AWS is carbon emissions, and all of that kind of stuff, is that active stuff, you can look at AWS metrics, you can instrument your app, so you can get really in depth questions that you can you can get the answers to those in depth questions. The tools are there. You just need to care.
Lea Mladineo 36:52
And use a proper one. Yeah.
Brandon Minnick 36:56
So for So for folks listening right now. That are there with you, Martin, we're onboard. I've got my Avis Council open on the website, we're where do I go to find these logs and start dating in?
Martin Thwaites 37:16
Well, obviously, what you do need to do is buy a tool I click on first. No, is the that you can do this with free tools there. CloudWatch metrics are there. The cloud watch metrics will show you a lot of this kind of stuff. They'll show you what your utilization is, you'll show you your lambda costs, they'll show you your lambda usage in terms of milliseconds per invocation, all of that kind of stuff. Look at those things, look at the outliers, look at the averages. Look at the utilization first, at the infrastructure level, you can do that through the AWS portal. There are other tools out there that you can use those. So bringing those into opentelemetry world. So bringing that into those metrics out of cloud watch and sending them to open telemetry providers that are built for this kind of stuff, the built for that individual analysis.
Lea Mladineo 38:15
Yeah, so starting from the cost is probably the easiest thing, because it also speaks to your CFO, someone there is going to care and going to say, Yeah, I am interested in this. Let's let's talk how do we get the cost down? What I mean, who wouldn't? I think that's the first, we do need to get a bit more accurate. Carbon emissions, which we I don't think we have yet. And this is Brendan, where you can help us with AWS advocating for that the same as we are getting this is how much CPU we're using. This is how much memory we are using. This is a you know, all of those metrics that we are used to getting. Eventually, we also want to get to this is how many carbon how much carbon we are emitting, because the energy is also not the great proxy because you don't know where the energy is coming from. So it could be a renewable energy source, it could be that you're potentially running during the night when there is enough energy. So you know, starting with the costs, because it's the simplest, it's it speaks to the wider audience, more people are interested in it, moving that to the energy, but also being mindful that energy is not a great proxy. It is a good proxy, but not great. And then ideally, I don't think we have this yet. It's just carbon emissions, knowing how much carbon we are producing, because we could be making decisions. Not over promising with our software but saying, Hey, you don't need this right now. Right? Okay. I'll run it eventually when the gray This is not under load, or when I have access to this energy that is free, and that is not releasing carbon. So there is a lot more that we can do. But as Martin said, like, probably look at the things that are costing you the most, which are taking a long time, just these painful things that are there for starting, you don't need to wait for this perfect metric or, you know, perfect answer. And the perfect service that it's going to do it all for us. We can do something right now. And we can start thinking about it. And it really nicely fits into the existing, you know, resilient, performance secure. What else? Did I say something cheaper? Yeah, the important one. If you have zombie servers that are just sitting there, like that's also a security issue by killing that zombie process that is not used by anything, or even a feature. It is not used by anyone. You're just killing bad surface that hackers can attack your service through. By using, yeah,
Martin Thwaites 41:10
sorry, as a proxy, to know what's going on in your infrastructure. That flywheel of benefit of just Oh, I know what's going on. Because I'm trying to save money. Oh, I know what's going on. So Oh, I know what's going on. Oh, wow. Okay, these things are going on. I should probably solve those. It's it is that flywheel it just has so many different impacts, knowing what's going on and carrying what's going on.
Lea Mladineo 41:39
Yeah, I mean, even using Spot Instances in there are cheaper than the normal fargate instances. But they're also providing you really nice feature that you making your software resilient, because you have absolutely no idea when the instance is going to shut down. And if it's going to be successful operation right there. And then, and instead of making that instance, or resource redundant, I'm sorry, like making the next one where if this one fails, you're just able to switch it to another one, make your thing resilient, be able to run itself again and succeed eventually, it really is just good software engineering. And we want to when we are developing, we're creating software, think about it in that way, it really doesn't conflict with all of the other things Illa T's that we want from our software,
Martin Thwaites 42:33
concrete example that is using things like poly to do retries when things fail, because what that allows you to do is say that my service might take a minute to respond. Because I've got a I'm waiting for it to scale up. That's okay. If that response time doesn't need to be milliseconds, if I don't need that thing to be responding right now, in this millisecond, I can cope with a little bit of auto scaling. Now, if that's okay, then add resiliency stuff like Polly, and just say, yeah, it's okay for that to respond. Now, if you're doing something on the front end, and you need things in milliseconds. That's important. If you're doing a batch process, that you're doing some data analytics that you're running, you run it in AWS batch, and you're trying to run this and it's going to take a day to run. The fact that it takes five minutes to spin up is not a problem. Having a ton of instances there just waiting for that thing that it might happen is not the right idea. You've been for blofield talk. But yes, the the the reality is that that also has a cost impact. Because now all of a sudden, I don't care can use Spot Instances, the reason why pot Spot Instances are cheaper is because they were already running. The reason why they give you Spot Instances cheaper is that was always always going to run that hardware anyway, in this sort of auto scale capacity. I just might need to kill it. If somebody actually needs it and requires it, then I'm going to use it. And that's the reason why it's so it's more efficient. And that's why it's cheaper.
Lea Mladineo 44:17
Yeah, it's it's funny that if we use a service managed service that fits the purpose or the tool, it's usually cheaper. So if it's not cheap, think about it. Like what are you doing wrong? How are you misusing it? And I'm sure you can see that Martin with Honeycomb and, and monitor people come in, like, why is this expensive? Are you using it in the right way? Like, are you using the tool, how it's intended to be used? Like, I mean, we use a lot of managed services from AWS and like when our bill goes up is like, okay, what are we doing wrong? How is this intended to be used? And how did we design our service to not fit that and how should we because it's sort of now Engaging use you like, good, again, good engineering practices and how the service should look like and and do the thing.
Martin Thwaites 45:10
Yeah, I think the whole thing we're coming around to is that proxy is a really, the cost is a really good proxy for efficiency. And efficiency is a really good proxy for carbon emissions, the real time ones that we're doing right now, maybe not a good proxy for the overall supply chain, carbon emissions, and all of that kind of stuff. But it is a really good proxy and a macro thing that you can start with. And I think dotnet are doing amazing things around improving the Common Language Runtime, the thing that everything runs on. That means we don't have to really think about optimizing our software, because they're going to optimize it in general. I mean, one of the things that most people forget, though, is they think about response time, they think, how do I make this thing respond quicker? When the relay is through pot, because through pot allows you to run fewer items, you know, if I've got if I've got to handle 1000 requests, and each one of my servers can only take 500 requests, I need to run two servers. If I can make one server, be able to service more requests, I can run one server. So thinking about throughput, just as much as you think about response time is really important.
Lea Mladineo 46:26
I think we also became very spoiled by one thing, everything there now immediately, like I want delivery being yesterday, and even though I like someone thinking what I need. So even when designing our services, or bringing value to the clients like t really need this immediately, of course, if it's something in the UI I needed, but as you mentioned, if it's a batch process is really important, if it's two minutes or five minutes, or can I run it overnight. Like we get this desire to prove that everything is really fast, and everything is really there. But it doesn't need to be and and we just kind of like cornering ourselves with these SLAs. And these wild numbers, were actually doesn't need to be that false and who are what are we trying to prove? Another thing that I would like to mention with code efficiency, and because you're saying we're not going to move to C, and we're not going to move to assembly. But we can use libraries that are tested that are used by many, many people on a hyper scale that are potentially written in assembly, but I can use them within dotnet. To make that thing very efficient, like cryptography, I'm not going to write my own algorithm to make something secure, I'm going to use something that someone else written that has tested that many millions of people many applications are using, why would I need to write that myself. So along using cloud providers managed services, it's also about using just the tools that are out there that are well tested while performing. So I don't need to make that part of my code and application that performance, we just kind of forget that we can use something that is out there that already exist.
Martin Thwaites 48:22
I think don't be scared to think about paying for these things. There's so many people who will use something way more inefficient, to avoid having to pay for something. And that I think has a detrimental impact to not just the green culture that we're trying to push. But it's also detrimental to the open source community and the the sort of distributed nature of people building things in dotnet. I mean, you mentioned image stuff. Image sharp is probably the most efficient piece of software round doing image manipulation in dotnet. And that is something that people won't pay for, they will try and find the free ones that aren't as efficient. And if we don't monitor those things, if we don't see the actually image sharp is maybe twice or three times as fast as the other library that we were going to use, not just about the developer efficiency, but also about the the efficiency on Compute, using those libraries and seeing that maybe we need to advocate for some of these libraries to start talking about how efficient they are from a green perspective, so that people can become a bit more conscious about it. Because what that does is allow you to be able to go to your CFO and say, Well, we're gonna buy this library. It's like, oh, well, you know, that's, that's, that's not from Microsoft. from AWS. It's like, Yeah, but it will save you about 10,000 pounds a year. It's like what do we sign?
Brandon Minnick 49:54
Yeah, I think and that's my biggest takeaway from this conversation so far is that I think I tried to be as smart as you something else that a smart person has. Yes, but But the lens of, you know, when it's easy to kind of grow and roll your eyes, when somebody brings up the topic of Green Clean Energy, you know, it, it has become a bit cliche nowadays, and there's certainly folks out there, they're like, oh, great, just because a turtle got a straw on its nose, I gotta drink paper straws now, which, yes, we don't want to draw us go and turtle noses. But at the same time, what we're talking about here is just building, building better, or using better tools, writing better software. And it all is cheaper. So not only do we get the benefits of writing greener software, running it on more efficient hardware, our bottom line gets better too. And I feel like as software engineers, we don't get that opportunity very often. There's not a lot of points in my career. And I can probably count on one hand, or I can go to a VP and CFO and say, hey, I can save the company money by doing X, Y, and Z. And in this case, we can do that. And we get the benefit of knowing that we're building a better planet for for our children's future. And I feel like that's something we can all align on. It's almost like the green, the sustainable, the, you know, the kind of a hippie movement of the 70s, it's come full circle. And now it's just, we're just talking about saving money. And if it happens to reduce carbon emissions, if it happens to do our server costs, that that all just kind of goes hand in hand now. So it's easy to say easy wins. Because we all have to put in the effort, we all have to look at our logs like Martin was saying, and you know, see how long it takes for our lambdas to invoke. See, like Leo was saying how efficient rec two is running, we have to put in that legwork and figure that out. But if we do and when we do, then we all win, we all benefit from it. And
Lea Mladineo 52:25
it's really nice, while it's not. So, you know, mandatory at the moment, but we are seeing the regulation and law being changed where you will need to report your emissions. So I think even AWS is committed to being carbon neutral carbon zero, like I have something along those lines. But also companies, they will need to pay extra money based on the carbon emissions that are doing, it's not a law yet that I know of. But these things are being more monitored. And even like our client funders, as clients or investment institutions, in that industry, in the financial institution, industry, it's becoming more important how they are impacting the environment. So they're also asking their suppliers to give the reports on how they are impacting the environment. So cool, it's not mandatory yet. But soon, we will need to pay extra know that we will need to pay to AWS more money, if you're not doing this, we are on top of that going to need to pay extra money, it probably will not be even worthwhile being there as a company, if you're paying the double costs of not making this more efficient, and not impacting the environment. And something you know, like we can't make it carbon neutral, our offices or you know, like we still need to commute to work and we are still you know, all of this kind of things that are not Software wise. So infant jobs will offset those. But software, we can do something. And soon we will need this, it's not going to just be nice to have and, and let's be you know, good, haven't good, high moral and think about this and save some money to the company. It's the new world and we as the business. And as developers, as an industry. We just need to adapt to it because it's not going to be optional, soon. Don't
Martin Thwaites 54:29
think it's hard. This is the thing that people think this is such a hard thing to do. You know, making your system observable so you can see these things making doing upgrades to make sure that you're on the latest and greatest dotnet so that it's more efficient. These are the these are not hard things to do. They're just things that you need to do and they have so many side benefits. You know, if you're on dotnet eight, you can use the new C sharp language features As you know, you can then start to be more efficient in your code, they have side benefits, don't think it's hard to just keep up with the modern coding, keep up with the the frameworks, start thinking about looking at stuff, it's not hard. It's almost like faster, cheaper and greener aren't mutually exclusive. Maybe you should do a talk about that.
Brandon Minnick 55:25
It's an excellent point, I totally agree, Martin, you know, I've loved the three benefits I get from just changing dotnet, six to dotnet, eight, and all of a sudden, less memory cache, memory consumption and fewer garbage collections. But also, later, we only have a couple minutes left, kicked off to the top of the hour. And as Martin mentioned, we haven't, we would scroll down the bottom of the screen here. But you've given a fantastic talk called faster, greener, cheaper, pick three of the name of it. So we'll we'll have the link to the video on YouTube. So be sure to grab that from from the description or grab it in the comments. And I also wanted to promote you. We're also on dotnet rocks. So one of the biggest, best podcasts alongside dotnet, native your show, of course. But the dotnet rocks, Episode 1873 as featuring also talking about sustainable sustainable development. So we know we can find you there. But like anybody who wants to keep up with the movement, stay in touch with you online, where can they find you to stay plugged in?
Lea Mladineo 56:43
Probably LinkedIn, I'm very bad at Twitter, or x or whatever the name is. And I tried the some other social media and I'm like, I'm not just not cut out for it. LinkedIn is probably the best. And it's going to be easy to search me by name and my first name and last name. I don't think they're to allow millennials, so don't worry, you'll find honestly, it's okay. But yeah, I'm horrible with social networks and keeping up to date. With that.
Brandon Minnick 57:15
We'll do well, we'll, we'll stay plugged in. We'll follow you on LinkedIn. And Martin, thank you so much for joining us on yet another episode of the dotnet and AWS show. For folks who want to stay plugged in with you, where can they find you?
Martin Thwaites 57:31
Everywhere. Absolutely bad social media, but I'm everywhere. Martin dotnet. Everywhere. I've actually just started a little bit of a YouTube channel that I'm going to start putting up some more observability videos and opentelemetry videos on. So if people are interested in understanding how open telemetry works, and there'll be some AWS ones on there as well, specific to how we can start pulling in some stuff from there as well. So have a look at that.
Brandon Minnick 58:01
We'll do well, thank you both so much again for for coming on the show today chatting with us about it. I promise. I didn't know that the answer was to just use AWS. It'll make your software greener before having on the show today. But I'll take it. And plus you get all the benefits of running our software in the Cloud and alongside of it. So thanks again so much for joining us. And thank you. Thank you for watching. Thank you for listening, make sure to subscribe to the AWS channel on Twitch. We're here every other week, every other Monday. You can find the dotnet on AWS show. And if you haven't already, be sure to subscribe to our audio podcast where you can take us with you on the go. You can find on any of your favorite platforms, Spotify, Apple podcasts, it's called the dotnet a give a show make sure subscribe there as well, so you never miss an episode. And we'll see you again in two weeks.
Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.