public inbox for [email protected]  
help / color / mirror / Atom feed
Somewhat excessive version checks
6+ messages / 3 participants
[nested] [flat]

* Somewhat excessive version checks
@ 2021-01-11 22:05 Magnus Hagander <[email protected]>
  2021-01-12 04:59 ` Re: Somewhat excessive version checks Khushboo Vashi <[email protected]>
  2021-01-12 08:56 ` Re: Somewhat excessive version checks Dave Page <[email protected]>
  0 siblings, 2 replies; 6+ messages in thread

From: Magnus Hagander @ 2021-01-11 22:05 UTC (permalink / raw)
  To: pgadmin-hackers <[email protected]>

Hi!

If I read the code correctly, pgadmin will (unless turned off) hit the
website to check the version.json file for updates *every time it
starts*.

Wouldn't it make sense to rate limit that to checking say once per 24
hours maximum? Or even 48?

It seems nobody needs the update *that* quickly, and AFAICT it does
call out to make that check synchronously on startup which means the
user is waiting.

And if/when doing that, it would be useful to include an
If-Modified-Since header on the request, so the server can just
respond with a tiny 304 reply when there is no update, which is going
to be the majority of the time. Or possibly even more efficiently,
create a custom etag and use If-None-Matches. If you make that etag be
say the version that the client has, it becomes very cheap to check
and you don't need to track any extra data.

-- 
 Magnus Hagander
 Me: https://www.hagander.net/
 Work: https://www.redpill-linpro.com/





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Somewhat excessive version checks
  2021-01-11 22:05 Somewhat excessive version checks Magnus Hagander <[email protected]>
@ 2021-01-12 04:59 ` Khushboo Vashi <[email protected]>
  2021-01-12 19:50   ` Re: Somewhat excessive version checks Magnus Hagander <[email protected]>
  1 sibling, 1 reply; 6+ messages in thread

From: Khushboo Vashi @ 2021-01-12 04:59 UTC (permalink / raw)
  To: Magnus Hagander <[email protected]>; +Cc: pgadmin-hackers <[email protected]>

On Tue, Jan 12, 2021 at 3:36 AM Magnus Hagander <[email protected]> wrote:

> Hi!
>
> If I read the code correctly, pgadmin will (unless turned off) hit the
> website to check the version.json file for updates *every time it
> starts*.
>
> Wouldn't it make sense to rate limit that to checking say once per 24
> hours maximum? Or even 48?
>
> It seems nobody needs the update *that* quickly, and AFAICT it does
> call out to make that check synchronously on startup which means the
> user is waiting.
>
> Agreed, we should have some mechanism in place to limit the server hit,
maybe an asynchronous call from the client while loading.


> And if/when doing that, it would be useful to include an
> If-Modified-Since header on the request, so the server can just
> respond with a tiny 304 reply when there is no update, which is going
> to be the majority of the time. Or possibly even more efficiently,
> create a custom etag and use If-None-Matches. If you make that etag be
> say the version that the client has, it becomes very cheap to check
> and you don't need to track any extra data.
>
> --
>  Magnus Hagander
>  Me: https://www.hagander.net/
>  Work: https://www.redpill-linpro.com/
>
>
>


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Somewhat excessive version checks
  2021-01-11 22:05 Somewhat excessive version checks Magnus Hagander <[email protected]>
  2021-01-12 04:59 ` Re: Somewhat excessive version checks Khushboo Vashi <[email protected]>
@ 2021-01-12 19:50   ` Magnus Hagander <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Magnus Hagander @ 2021-01-12 19:50 UTC (permalink / raw)
  To: Khushboo Vashi <[email protected]>; +Cc: pgadmin-hackers <[email protected]>

On Tue, Jan 12, 2021 at 5:59 AM Khushboo Vashi
<[email protected]> wrote:
>
>
>
> On Tue, Jan 12, 2021 at 3:36 AM Magnus Hagander <[email protected]> wrote:
>>
>> Hi!
>>
>> If I read the code correctly, pgadmin will (unless turned off) hit the
>> website to check the version.json file for updates *every time it
>> starts*.
>>
>> Wouldn't it make sense to rate limit that to checking say once per 24
>> hours maximum? Or even 48?
>>
>> It seems nobody needs the update *that* quickly, and AFAICT it does
>> call out to make that check synchronously on startup which means the
>> user is waiting.
>>
> Agreed, we should have some mechanism in place to limit the server hit, maybe an asynchronous call from the client while loading.


Seems async front he server would be a better choice there, if you
have some ways for that? Otherwise, how to determine which user to
trust when storing the result etc?

-- 
 Magnus Hagander
 Me: https://www.hagander.net/
 Work: https://www.redpill-linpro.com/





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Somewhat excessive version checks
  2021-01-11 22:05 Somewhat excessive version checks Magnus Hagander <[email protected]>
@ 2021-01-12 08:56 ` Dave Page <[email protected]>
  2021-01-12 19:50   ` Re: Somewhat excessive version checks Magnus Hagander <[email protected]>
  1 sibling, 1 reply; 6+ messages in thread

From: Dave Page @ 2021-01-12 08:56 UTC (permalink / raw)
  To: Magnus Hagander <[email protected]>; +Cc: pgadmin-hackers <[email protected]>

On Mon, Jan 11, 2021 at 10:06 PM Magnus Hagander <[email protected]>
wrote:

> Hi!
>
> If I read the code correctly, pgadmin will (unless turned off) hit the
> website to check the version.json file for updates *every time it
> starts*.
>

Every time the server starts, which is a little different, but still...


>
> Wouldn't it make sense to rate limit that to checking say once per 24
> hours maximum? Or even 48?
>

That certainly wouldn't be a bad idea.


>
> It seems nobody needs the update *that* quickly, and AFAICT it does
> call out to make that check synchronously on startup which means the
> user is waiting.
>
> And if/when doing that, it would be useful to include an
> If-Modified-Since header on the request, so the server can just
> respond with a tiny 304 reply when there is no update, which is going
> to be the majority of the time. Or possibly even more efficiently,
> create a custom etag and use If-None-Matches. If you make that etag be
> say the version that the client has, it becomes very cheap to check
> and you don't need to track any extra data.
>

Patches welcome!

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EDB: http://www.enterprisedb.com


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Somewhat excessive version checks
  2021-01-11 22:05 Somewhat excessive version checks Magnus Hagander <[email protected]>
  2021-01-12 08:56 ` Re: Somewhat excessive version checks Dave Page <[email protected]>
@ 2021-01-12 19:50   ` Magnus Hagander <[email protected]>
  2021-01-13 09:02     ` Re: Somewhat excessive version checks Dave Page <[email protected]>
  0 siblings, 1 reply; 6+ messages in thread

From: Magnus Hagander @ 2021-01-12 19:50 UTC (permalink / raw)
  To: Dave Page <[email protected]>; +Cc: pgadmin-hackers <[email protected]>

On Tue, Jan 12, 2021 at 9:57 AM Dave Page <[email protected]> wrote:
>
> On Mon, Jan 11, 2021 at 10:06 PM Magnus Hagander <[email protected]> wrote:
>>
>> Hi!
>>
>> If I read the code correctly, pgadmin will (unless turned off) hit the
>> website to check the version.json file for updates *every time it
>> starts*.
>
>
> Every time the server starts, which is a little different, but still...

Hmm. So one of us is definitely reading things wrong then :) I see it
in the index() method, which has an URL router for / -- isn't that
called for every time somebody somebody starts their browser to it?
I'm not saying for every reload, but with a server install with 10
users, won't it do it once for each?

Or when is that actually called?


>> Wouldn't it make sense to rate limit that to checking say once per 24
>> hours maximum? Or even 48?
>
>
> That certainly wouldn't be a bad idea.
>
>>
>>
>> It seems nobody needs the update *that* quickly, and AFAICT it does
>> call out to make that check synchronously on startup which means the
>> user is waiting.
>>
>> And if/when doing that, it would be useful to include an
>> If-Modified-Since header on the request, so the server can just
>> respond with a tiny 304 reply when there is no update, which is going
>> to be the majority of the time. Or possibly even more efficiently,
>> create a custom etag and use If-None-Matches. If you make that etag be
>> say the version that the client has, it becomes very cheap to check
>> and you don't need to track any extra data.
>
>
> Patches welcome!

Hah, I clearly can't even figure out when the method is called :)

And presumably you'd also want some place to store the state between
calls, so you can keep showing the warnings about upgrades? Do you
have state storage for such things arleady=

-- 
 Magnus Hagander
 Me: https://www.hagander.net/
 Work: https://www.redpill-linpro.com/





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Somewhat excessive version checks
  2021-01-11 22:05 Somewhat excessive version checks Magnus Hagander <[email protected]>
  2021-01-12 08:56 ` Re: Somewhat excessive version checks Dave Page <[email protected]>
  2021-01-12 19:50   ` Re: Somewhat excessive version checks Magnus Hagander <[email protected]>
@ 2021-01-13 09:02     ` Dave Page <[email protected]>
  0 siblings, 0 replies; 6+ messages in thread

From: Dave Page @ 2021-01-13 09:02 UTC (permalink / raw)
  To: Magnus Hagander <[email protected]>; +Cc: pgadmin-hackers <[email protected]>

On Tue, Jan 12, 2021 at 7:50 PM Magnus Hagander <[email protected]> wrote:

> On Tue, Jan 12, 2021 at 9:57 AM Dave Page <[email protected]> wrote:
> >
> > On Mon, Jan 11, 2021 at 10:06 PM Magnus Hagander <[email protected]>
> wrote:
> >>
> >> Hi!
> >>
> >> If I read the code correctly, pgadmin will (unless turned off) hit the
> >> website to check the version.json file for updates *every time it
> >> starts*.
> >
> >
> > Every time the server starts, which is a little different, but still...
>
> Hmm. So one of us is definitely reading things wrong then :) I see it
> in the index() method, which has an URL router for / -- isn't that
> called for every time somebody somebody starts their browser to it?
> I'm not saying for every reload, but with a server install with 10
> users, won't it do it once for each?
>
> Or when is that actually called?
>

Huh, no you're right. It's a long time since I wrote that code :-/


>
>
> >> Wouldn't it make sense to rate limit that to checking say once per 24
> >> hours maximum? Or even 48?
> >
> >
> > That certainly wouldn't be a bad idea.
> >
> >>
> >>
> >> It seems nobody needs the update *that* quickly, and AFAICT it does
> >> call out to make that check synchronously on startup which means the
> >> user is waiting.
> >>
> >> And if/when doing that, it would be useful to include an
> >> If-Modified-Since header on the request, so the server can just
> >> respond with a tiny 304 reply when there is no update, which is going
> >> to be the majority of the time. Or possibly even more efficiently,
> >> create a custom etag and use If-None-Matches. If you make that etag be
> >> say the version that the client has, it becomes very cheap to check
> >> and you don't need to track any extra data.
> >
> >
> > Patches welcome!
>
> Hah, I clearly can't even figure out when the method is called :)
>
> And presumably you'd also want some place to store the state between
> calls, so you can keep showing the warnings about upgrades? Do you
> have state storage for such things arleady=
>

Yes - the SQLite config database.  See pgadmin.model.

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EDB: http://www.enterprisedb.com


^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2021-01-13 09:02 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-01-11 22:05 Somewhat excessive version checks Magnus Hagander <[email protected]>
2021-01-12 04:59 ` Khushboo Vashi <[email protected]>
2021-01-12 19:50   ` Magnus Hagander <[email protected]>
2021-01-12 08:56 ` Dave Page <[email protected]>
2021-01-12 19:50   ` Magnus Hagander <[email protected]>
2021-01-13 09:02     ` Dave Page <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox