Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1

I created a website with CoucCMS that we use as a backend, processing hundreds of requests per day. A frontent website sends POST-Requests to a template in the backend website, that processes this data, creates a new data page of a clonable template, sends a mail to the cusromer and then redirects back to a thank you page of the originating website.

In the backend website, some pages take some seconds to load, because it generates lists with thousands of instances of cloned pages with about a dozen of fields. Some other pages generate statistical charts that take also amstutz gnoficant amount of time. These pages are already highly optimized with dedicated SQL queries, but sometimes the creation of a statistics page still needs about a minute.

Now to the problem: When an internal user (employee) loads such a time consuming page and, while the page is loading, a customer sends a request from a frontend website, it is blocked until the other page is loaded, and only after that it is redirected. So the customers waits up to about a minute in the worst case, without gett ng a feedback.

Does CouchCMS block all other page requests when processing a database request? Or can I change some settings so that the pages do not have to wait for another page finished loading?

I already tried running the API-template page without accessing to the database (no get_field, pages, etc.), but it is still blocked.

Any idea?

Oh, this is not new, I've seen it and reported to @KK a while ago. From my local experiments server's load (your thousands of pages) doesn't matter. It is a known PHP Session Locking (google it) which happens in Couch. My advice 1: avoid lengthy operations during page request completely by setting up jobs in background in separate delayed request & 2: go through Couch code and amend code to deblock session.
Maybe it is possible in your application to have 2 installations of Couch - one for frontend and one for analytical things, sharing the same database. Different PHP scripts therefore should not block each other's requests in theory. Interesting to know if you gonna try any of the possible solutions.
I found some code I added a while ago that slowed down the application, or stopping cache from working respectively. After removing this the app loads faster, and after reloads quickly after initial load it seems that the results of the requests done are cached.

It is the following code which served for proper trimmed output of the page:
Code: Select all
<?php ob_start(); require_once( 'couch/cms.php' ); ?>
<?php COUCH::invoke( K_IGNORE_CONTEXT ); ?>
   echo trim($content);

BUT, the problem of blocking parallel loading of pages/requests is not solved.
4 posts Page 1 of 1

Who is online

In total there are 5 users online :: 0 registered, 0 hidden and 5 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 5 guests