Quota issues with Google App Engine frontend hours

Hey everyone, I’m new to Google App Engine and I’m running into some trouble. My frontend instance hours keep maxing out even when I’m not using the server much. It’s supposed to be 28 hours but it seems to run out super fast. Any tips on how to fix this?

Also, I got $300 free credit for the trial, but I can’t seem to use it. Every time I try to set a daily budget in the App Engine settings, I get an error saying some settings weren’t updated. I’ve tried different amounts but nothing works.

Has anyone else run into these problems? I’m scratching my head here. Any help would be awesome!

def check_quota():
    current_usage = get_instance_hours()
    if current_usage >= MAX_HOURS:
        print('Quota exceeded!')
    else:
        print(f'Hours remaining: {MAX_HOURS - current_usage}')

def set_daily_budget(amount):
    try:
        update_settings(daily_budget=amount)
        print('Budget updated successfully')
    except Error as e:
        print(f'Failed to update budget: {e}')

# Main execution
check_quota()
set_daily_budget(10)  # Trying to set $10 daily budget

I added a simple code example to show what I’m trying to do. Any ideas on what might be going wrong?

hey ava, sounds frustrating! have u tried adjusting ur instance class? Sometimes switching to F1 can help stretch those hours. for the budget issue, maybe try setting it through the Cloud Console instead of App Engine settings? it’s a bit roundabout but might work. curious tho, what kind of app are u building? :thinking:

Regarding your frontend instance hours issue, it’s crucial to optimize your app’s scaling configuration. Consider implementing automatic scaling with a minimum number of instances set to zero. This allows your app to scale down to zero instances when there’s no traffic, significantly reducing idle time and conserving hours.

As for the budget setting problem, it might be related to your billing account setup. Ensure your billing account is properly linked to your project and that you’ve enabled billing for the specific services you’re using. If the issue persists, try using the Google Cloud CLI to set the budget instead of the web interface. This often bypasses UI-related glitches.

Remember to monitor your app’s performance metrics closely and adjust your configuration accordingly. It’s a process of continuous optimization.

yo ava, i feel ur pain! had similar issues when i started. for the frontend hours, try setting a lower idle timeout in app.yaml. like 5 mins instead of default 15. helps conserve hours big time.

for the budget thing, sounds like a glitch. try clearin browser cache or use incognito mode. if that dont work, hit up GAE support. they sorted me out quick.