I currently have apc installed and running under php-fpm. The apc info page reflects user cache entries but the file cache reflects 0 files cached. Other similar threads state that if runnning under FCGI, apc will not share the cache between the worker processes, and recommend using php-fpm. I share the symtoms with these people, however I am already using php-fpm and it is running fine. If anyone has any idea here, would be greatly appriciated. Been stuck on it at work for a couple hours now. I have another box set up where it is working and I believe I followed the same procedure, and both boxes are identical. Not sure where I could have gone wrong. I would be happy to provide more information. Thanks.
Update : When compiling APC with debug, I get file too big errors with every file. This is not the case on the working box. Looking through the source, I found the relevant snippet -
if(APCG(max_file_size) < fileinfo->st_buf.sb.st_size) {
apc_debug("File is too big %s (%d - %ld) - bailing\n" TSRMLS_CC, filename,t,fileinfo->st_buf.sb.st_size);
goto cleanup;
}
It has the correct filesize in the fileinfo strut, so I'm imagining that max_file_size is messed up. I'm going to try and track this down. Anyone have any idea? This is working fine on 64 bit Ubuntu outside of EC2, with identical configuration and files.
All the build tests from source are failing and hardcoding that value in doesn't help, it still doesn't cache.
Related
We have some files on our portal that aren't that big to me: 50MB-80MB. On my home connection, it takes <10seconds to download these files. I've had other users test and they experience the same thing.
However, in the office, the connection is terrible. These files don't even download because once the download time gets to about 30-35 seconds, even though it is downloading (just incredibly slow), it triggers a non-descriptive error in the Developer Tools > Network and stops the download. Not seeing anything in any logs that indicates why the download is terminated.
The bigger problem is we now have a few end users with crappy internet who are also experiencing the same issue.
So I'm trying to figure out what we can do on our end. Obviously, we can't tell them, "Well, just get better internet service." It seems like there can be something done on our end to persist the download until it is completed. What that is, I'm not quite sure and that is what I'm looking for help on. Maybe it is a default setting in a dependency somewhere in our stack.
ReactJS FE that uses FileSaver.js for downloads
Django BE using native Django downloading
nginx-ingress for traffic ingress controller to the Kubernetes cluster
The FE uses nginx to serve the FE
The BE uses gunicorn to serve the BE
Any suggestions on what I should do to prevent this timeout on downloads?
I'm thinking the issue is somewhere with nginx-ingress, nginx, and/or FileSaver.js, so investigating those.
Per Saurabh, adjusting the timeout did the trick. I now just start the web server with the -t 300 flag and the users that were having issues no longer do.
The problem I've been having is that whatever changes I made to twig templates, they never appear on the PROD site without cache:clear commands in console.
There are times when checking rapid iterations on a live site are useful without a lot of shell cache clearing.
This led me to ask, Is there a simple way to temporarily disable Symfony 5.1's PROD caches (so that it works more like DEV caches) on a fairly standard setup?
There are a number of documents such as https://symfony.com/doc/current/reference/configuration/twig.html -- but they didn't really help resolve the issues I've had.
After some further digging and experimentation, I found that changing:
//twig.yaml
twig:
default_path: '%kernel.project_dir%/templates'
cache: 'false'
auto_reload: 'true'
seemed to do the trick, but you still have to cache:clear one further time for it to start working.
I have no idea why this should be necessary, but at least it is functioning as expected now.
my Symfony 3 app works flawless on my local webserver. Since it´s been installed on the remote web server it produces a blank page, even the routing doesn't work. After editing web/app.php $kernel = new AppKernel('prod', false); and set it to true, the application works as expected and does not display any errors.
Why does the application behave different on the local and the remote webserver. Did I miss to configure something on the remote server?
Any suggestions?
Thanks in advance!
Finally I have a solution to solve the problem: after the composer update I have to clear the cache of the prod environment manually by executing rm -fr var/cache/prod/*. For whatever reason does the command php bin/console cache:clear --env=prod quit working immediately after the composer update without throwing any error messages. After removing the cache files manually both the application and the cache:clear command work as expected without modifying web/app.php.
1.check permission to cache and log dirs ( need to be 777 )
2.check (paste here) error in logs/prod.log
Since I couldn´t find out what´s the real cause of this problem I´ve made a fresh install of my application and updated Symfony and all dependencies with composer.
Although I did the same with the old installation, it does the trick this time. My guess is, something went wrong with the composer update before.
Thanks again for your help! If someone has a similar problem I would appreciate if you could post how you solved the problem (or why AppKernel['prod'] = 'true' did work).
I have plausible explanation, what might have been the problem.
I have encountered this problem earlier this year with Symfony3, while developing on Windows but deploying manually (copying project's files) to shared server with Linux.
As you say - blank page in prod environment.
To add to the mystery log files did not show any problems
So i enabled dev environment to check what is wrong
application worked as intended if i added app_dev.php in the URL
I overviewed all the files, more than once, but copy was done correctly.
The answer
After some time I "came across" the file: bootstrap.php.cache in var directory. It "felt suspicious".
As I had exhausted my options i just deleted it to test the result.
That solved it in my case.
Site was running again.
No more blank page!
I guess mixed development environment has its toll.
I've been floating around the Google and everything's getting more confusing now. What i want to know is how to install Memcache or Memcached. Even which one to install, i'm still not sure. It is super confusing.
I'm on Redhat RHEL. Actually i have installed Memcached (with 'd`) on my Web Server. Then according to the articles, i enabled Php Extension, etc. Then what is supposed to happen? Totally no improvement in performance.
Then i feel thats not enough and i googled again. Some say to install on MySQL Server. So what about PHP Extension and Drupal Module which are supposed to be configured, if i install it on MySQL Server? I'm really not getting it.
So i have Drupal 7 and please let me know in simple way for which is the right one to follow :(
Memcache or Memcached ? (Why this two so confusing?)
Where to put at?
Does it really need Drupal Module to work?
Please simply give me a straight dummy guide :(
"Memcache vs Memcached" - first one is a module (extension), second one is the daemon. See "Memcache Vs. Memcached" for full explanation
"Where to put at?" - you said you had it already installed on your server, it should be installed easily with some package manager e.g.:
pecl install memcache
"Does it really need Drupal Module to work?" - Yes, Drupal needs to know that you want to use memcache. The Drupal module will move cache, sessions and lock tables into memory (see https://drupal.org/project/memcache).
To make memcache module work, you need to put the following into settings.php (change you module path respectively):
# Memcache
$conf['cache_backends'][] = 'sites/all/modules/contrib/memcache/memcache.inc';
$conf['cache_default_class'] = 'MemCacheDrupal';
To see whether it works, go to "admin/config/system/memcache" (this is Drupal 7 path) and turn on "Show memcache statistics at the bottom of each page" - if everything works well, you should see something similar at the bottom of the page:
OPERATION BIN KEY HIT
get cache_bootstrap cache_bootstrap-variables 1
So I've recently setup a LEMP server and have managed to work may way through some of the configurations. I'm now to the point where I can begin writing php scripts and building basic pages. Looking at the php5-fpm wiki there aren't any pages discussing any changes I should expect as far as php scripts and such are concerned, only installation/configuration settings.
Is everything beyond the installation/configurations steps business as usual? From the point of view of a php developer what changes should I expect/make? How can best take advantage of the fpm version (in the php code, not module/system configurations)? I'm focused on comparing well-written php in both cases.
When I made the switch myself, I got to know a few perks about this kind of setup, such as APC file upload progress does not work out of the box (and you're better off using something else, such as nginx-progress-upload and/or JS File API); Some header names might have changed (prepending HTTP_); and a new and very useful function called fastcgi_finish_request.
For more information, though, look around the PHP-FPM Manual.
Only major gotcha I can think of is that some functions in the pcntl extensions, such as pcntl_fork, are not supported when running under FPM. (However, they're not supported under mod_php either, so this shouldn't come as too much of a surprise.)