vantage-sh / ec2instances.info

Amazon EC2 instance comparison site
https://ec2instances.info
MIT License
5.13k stars 579 forks source link

error in price of cache.r5.4xlarge in Virginia #644

Closed AstroTom closed 2 years ago

AstroTom commented 2 years ago

Bug: For some reason in Virginia it shows the price for cache.r5.4xlarge as $0.716000 hourly instead of the correct $1.724 It seems to be only in Virginia. In Ohio, for example it looks right. It even correctly shows the reserve price as much higher than on-demand. Sure did throw me for a loop! See https://instances.vantage.sh/cache/?selected=cache.r5.4xlarge

EverettBerry commented 2 years ago

Thanks! Definitely seems wrong, looking into it..

AstroTom commented 2 years ago

Maybe this is the same problem, but I see all kinds of inconsistencies between the on demand price and the Reserved price. i.e if I sort by on demand the reserved price is not in ascending order and visa versa. One of them has to be wrong. I see this now in several regions. I appreciate you guys are busy and can't fix every issue quickly, but if the basic cost data is not correct, then the tool becomes useless.

Thanks :-)

EverettBerry commented 2 years ago

Is this happening only for ElastiCache? EC2 and RDS look correct on a quick glance.

ElastiCache is the newest service and admittedly probably has not been tested as thoroughly. I am seeing this for these instances https://instances.vantage.sh/cache/?selected=cache.r5.large,cache.m5.xlarge,cache.r5.2xlarge,cache.r5.4xlarge,cache.m5.12xlarge,cache.r5.12xlarge

AstroTom commented 2 years ago

I have only noticed the problem with ElastiCache because it was obvious. Simply sorting by cost of either Redis or Memcached and the order of the RI will not match (or visa versa). Thanks for looking into this!

BRMatt commented 2 years ago

I just noticed this discrepancy when I saw that vantage was listing a cache.m5.xlarge as cheaper than a cache.m5.large:

CleanShot 2022-08-16 at 10 40 15

Here's the us-east-1 pricing page for elasticache:

CleanShot 2022-08-16 at 10 40 45

I wonder if the scraper is picking up the prices from the outposts table:

CleanShot 2022-08-16 at 10 42 01

AstroTom commented 2 years ago

That could be a nice catch @BRMatt! (I usually use the monthly cost, because it is more human readably)

EverettBerry commented 2 years ago

Nice find @BRMatt this appears to be the problem. I believe all these instances would be affected: image

We are not parsing this page per say, but we do ingest the json file that is loads from, https://github.com/vantage-sh/ec2instances.info/blob/master/cache.py#L67

This file includes a locationType which, for these instances, is "AWS Outposts" which for some reason is popped off the dict before we parse https://github.com/vantage-sh/ec2instances.info/blob/master/cache.py#L117

Then, we only take region and cache_engine into account when getting the Reserved pricing https://github.com/vantage-sh/ec2instances.info/blob/master/cache.py#L190

I've opened a branch, cache-price-error to apply the fix for this.

AstroTom commented 2 years ago

Great! Thanks so much for fixing it. I noticed another small issue. URL parameters like 'selected=' only work on the EC2 page, but not on the RDS or Elasticache page. e.g. the following drops all the params. https://instances.vantage.sh/cache/?selected=cache.r5.large,cache.m5.xlarge,cache.r5.2xlarge,cache.r5.4xlarge,cache.m5.12xlarge,cache.r5.12xlarge

I have tested this in Chrome (incognito) and Edge.

BRMatt commented 2 years ago

Amazing, thanks for fixing this @EverettBerry!