Skip to content

[$200] Priority - performance on prod #304

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jmgasper opened this issue Dec 21, 2020 · 9 comments
Closed

[$200] Priority - performance on prod #304

jmgasper opened this issue Dec 21, 2020 · 9 comments

Comments

@jmgasper
Copy link
Collaborator

@atelomycterus - We just deployed to prod, and performance still seems to be a bit weak. I'm seeing 15+ seconds to load the main page. This should have caching enabled now, so I'm not sure what else could be the delay.

What can we provide you to help debug this?

@jmgasper
Copy link
Collaborator Author

Contest https://www.topcoder.com/challenges/30159433 has been created for this ticket.

This is an automated message for ghostar via Topcoder X

@jmgasper
Copy link
Collaborator Author

Contest https://www.topcoder.com/challenges/30159433 has been updated - it has been assigned to obog.

This is an automated message for ghostar via Topcoder X

@atelomycterus
Copy link
Collaborator

atelomycterus commented Dec 21, 2020

@jmgasper let's check cache. Admin role required. Go to Plugins (/dashboard/settings/plugins). Enable Debug Bar. Debug Bar has a Debugger View Permission. Only Admin can see it.

Step 1. Check active cache

Go to Messages tab and click on topcoder_plugin: Cache.
What is the value of 'Active Cache'? if it is not equal to 'memcacned' => check PROD env parameters.
image

The list of parameters from config.php. Check CACHE_ENABLED (should be true) and CACHE_METHOD ( should be memcached):

// Cache
$Configuration['Cache']['Enabled'] = strtolower(getenv('CACHE_ENABLED')) === "true";
$Configuration['Cache']['Method'] = getenv('CACHE_METHOD');
$Configuration['Cache']['Memcached']['Store']=[getenv('MEMCACHED_SERVER')];

Step 2. Check cache type

What is the value of Type? If cache is active but type is not equal to 'ct_memory' => cache is not working.
Check MEMCACHED_SERVER and memcached connectivity.

Step 3. Timeline data

If cache is active and cache Type is 'ct_memory'.
Open the main page. Click on Timeline tab. Please select '#1' in the dropbox. #1 - a page request, not ajax request
image

Disable Debug Bar.

@rootelement
Copy link
Contributor

Hi @atelomycterus !

Thanks again for all your work on the forums, great feedback from the community so far!

Step 1

Screen Shot 2020-12-21 at 9 43 43 AM

Values of the config.php from the actual live server:

// Cache
$Configuration['Cache']['Enabled'] = true;
$Configuration['Cache']['Method'] = 'memcached';
$Configuration['Cache']['Memcached']['Store'] = array (
  0 => 'vanilla-forums.056cmt.0001.use1.cache.amazonaws.com:11211',
);

Step 2

It seems like that type is correct

Step 3

Screen Shot 2020-12-21 at 9 46 18 AM

I don't see any dropdown? I can't click the values in the top right of the debug bar.

@atelomycterus
Copy link
Collaborator

atelomycterus commented Dec 21, 2020

@jmgasper @rootelement

Thanks again for all your work on the forums, great feedback from the community so far!

Thanks! You're welcome!

Controller - 4+secs => It looks like categories/roles are not cached.
Render - 12+ secs => The main page shows up to 60 records. 60 records on a Recent Discussion page => It takes 0,2-0,4 sec to render one discussion due to Topcoder API requests.

Timeline in PROD is very close to what we had in DEV before using memcached + caching Topcoder data (handle,photo url and so on).
This screen from DEV, 60 records on the main page:
image

Cache Settings is ok on your screen. Have you checked server log's file and memcached log's file? Are there any errors?

My guess is that cache doesn't work. I mean nothing is written to cache and, accordingly, is not read from the cache. If
cache is working, you should see a list of categories/roles handles in memory cache. This data must be cached.

Let's check it.

Step 1

Could you check server log's file?
Are there any errors?

Step 2

Could you check memcached log's file?
Are there any errors?

Step 3

If there are no errors in both logs. Let's deploy Debug plugin in PROD. By default, it's deployed only in DEV. I'll fix it and it'll be deployed to PROD as well. (I've fixed it - PR-#305, Dockerfile has been updated.)

Check Categories Cache

Open/refresh the main page in another browser tab. if cache is working, then categories should be cached.
Check 'Categories'. You should see a list of all categories:

image

If you see 'Could not encode the response' => no data in cache.
image

Check Roles Cache

Check 'Roles'. You should see a list of all roles:
image

Check Topcoder Cache

Let's check Topcoder keys in cache.

  • use any Topcoder handle from a recent page. You need UserID to retrieve a cache key's value from cache.
    image

Go to Users page (https://discussions.topcoder.com//dashboard/user) and find User by name. You should see UserID at the bottom bar:
image

Topcoder Profile key is 'topcoder.{UserID}':
image

  • Disable Debug Plugin.

@atelomycterus
Copy link
Collaborator

@jmgasper @rootelement Quick fix to deploy Debug Plugin to PROD PR-#305.

@jmgasper
Copy link
Collaborator Author

@atelomycterus - Deploying now. I'll pull that information above later today.

@jmgasper
Copy link
Collaborator Author

Payment task has been updated: https://software.topcoder.com/review/actions/ViewProjectDetails?pid=30159433

This is an automated message for ghostar via Topcoder X

@jmgasper
Copy link
Collaborator Author

Fixed up a few broken config items based on your documentation above, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants