Commit b2c05d9c authored by Leigh B Stoller's avatar Leigh B Stoller

A couple of little tweaks to deal with slow login:

1. Change initial query in instantiate.php to ask for just the few
   fields we need. Profiles have rspecs and scripts, and that is a lot
   of data to return, given that the average user has access to 300+
   profiles cause of all the ones marked public.

   But in general, there is a lot going on in instantiate.php, which is
   where most users are redirected to after login, and that causes a lot
   of delay.

2. The MotherShip uses ZFS_NOEXPORT, so when logging in we have to see
   if we have to run exports_setup. exports_setup can take anywhere from
   5-25 seconds. The login path was forcing this once a day, but in fact
   exports_setup is using a week, so lets change the test to match that.

3. Show a soothing modal after pressing the login button to keep the
   natives happy.
parent 558c83bd
......@@ -221,7 +221,7 @@ else {
$query_result =
DBQueryFatal("select p.*,v.* from apt_profiles as p ".
DBQueryFatal("select p.uuid,, from apt_profiles as p ".
"left join apt_profile_versions as v on ".
" v.profileid=p.profileid and ".
" v.version=p.version ".
......@@ -17,6 +17,11 @@ $(function ()
// Login takes more then non-trivial time, say something soothing.
$('#quickvm_login_modal_button').click(function () {
sup.ShowWaitWait("We are logging you in, patience please");
......@@ -1040,7 +1040,7 @@ function DOLOGIN_MAGIC($uid, $uid_idx, $email = null,
# Ug. When using ZFS in NOEXPORT mode, we have to call exports_setup
# to get the mounts exported to back to boss. We do not want to do this
# every time the user logs in of course, and since exports_setup is
# using one week as its threshold, we can just do it on a daily basis.
# using one week as its threshold, we can use that as the limit.
$query_result =
......@@ -1054,7 +1054,7 @@ function DOLOGIN_MAGIC($uid, $uid_idx, $email = null,
$lastlogin = $lastrow[0];
$lastloginstr = $lastrow[1];
if (time() - $lastlogin > (24 * 3600)) {
if (time() - $lastlogin > (24 * 3600 * 6)) {
# Update weblogin_last first so exports_setup
# will do something.
DBQueryFatal("update user_stats set ".
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment