info@garnet-lab.com
РУССКИЙ
+7 495 414 18 36

3 minutes

Clearing space in Bitrix24

Автор статьи

Глеб Антоненко

Connect monitoring (for example, via Zabbix)

How to see how much space is occupied and what

Can backups be deleted?

Bitrix24 Disk Cleanup Wizard:

  • Disk → Clean up space → Start scanning → Switch to expert mode
  • CRM → CRM Settings → Other → What is taking up space → Start scanning

Expand the disk (on the hosting, virtual machine settings). Then expand the file system

 

Database optimization Go to the Performance Monitoring admin panel, sort tables by size. Compare with the table sizes from /var/lib/mysql/. If the latter are significantly larger, then there were deletions and it makes sense to optimize.

Run the command mysql optimize table [table name].

Important: This operation requires space because it first creates an optimized copy of the table and then deletes the old version of the table.

 

To resolve the issue, it is recommended to connect an external S3 storage. Then the server will be able to use the additional space for storing Disk files.

For the box: connect external S3 storage

Create S3 storage on one of the providers, for example:

Set up cloud storage in Bitrix24:https://dev.1c-bitrix.ru/learning/course/index.php?COURSE_ID=35&LESSON_ID=3102(Pay special attention to the rules. If we want all files from all Bitrix modules to be uploaded to the S3 storage, then we leave one empty rule.)

Next, you need to check/configure nginx for fast file delivery from S3 (in this case, PHP is used only to check access to the file, and the file itself is delivered via nginx, bypassing PHP). To do this, look at the file/etc/nginx/bx/conf/bitrix_general.conf. It already has ready-made settings for some S3 providers. If there is none for your provider, you need to add it. Here is an example for Timeweb:

    # Timeweb.cloud
    location ~ ^/upload/bx_cloud_upload/(http[s]?)\.([^/:\s]+)\.timeweb\.cloud/([^\s]+)$ {
        internal;
        resolver 8.8.8.8 ipv6=off;
        proxy_method GET;
        proxy_ssl_server_name on;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Server $host;
        more_clear_input_headers 'Authorization';
        proxy_set_header "cookie" "";
        proxy_set_header "content-type" "";
        proxy_set_header "content-length" "";
        proxy_pass $1://$2.timeweb.cloud/$3;
    }

After that, you can enable the “Fast file delivery via Nginx” option in the main module settings if it was disabled.

To check, upload a new file, make sure that it opens and downloads normally from the portal.

Next, you can upload existing files to S3. To do this, in the context menu of the created storage in Bitrix24, select “Move files to cloud storage”.

Have questions or need to find a solution to Your problem?

Leave a request by filling out the feedback form. Our expert will contact you as soon as possible