Gateway Timeout while deleting contacts in SuiteCRM 7.9.14

I’m getting the message 504 Gateway Timeout

“The gateway did not receive a timely response from the upstream server or application.”

Trying to delete all my contacts within the module contacs, so i can only delete some of them but not the whole archive.

How can i avoid this issue?

is there any other way to delete my contacts?

You need to modify your PHP settings to allow more memory and time.

My hosting allow me a max execution time of 120 seconds but the page stops after only 60 seconds so my SuiteCRM only deletes 50 to 100 contacts which is a pretty low number for that time isn’t it?

Let me see my memory settings in the php.ini then.

hey

I tried to delete all my contacts (3000 records)
During their removal I could not do anything else in suitecrm system
Also, none of the other users could access my site with suitecrm located. it looked like the server crashed but after a couple of minutes everything worked and all contacts were deleted.

I understand that while php uninstall script was running I could not do anything else.
I would like to know more about this.
I understand correctly that when I work with a large amount of data by deleting or importing it, other users will have problems at this time?
is there any way around this or it’s php limitation?

thanks

As I mentioned before. I believe that is a server restriction. If your server resources allow you, you should allocate more to the application.

AlxGr

To give some more detail, there are a bunch of PHP resource limits, editable in php.ini, that affect this, mainly

  • memory_limit
  • max_execution_time

But then your overall server resources also count: RAM, CPU, disk speed, etc

For larger operations, doing them from the UI is always very slow, and you should avoid doing them, especially during office hours.

The same delete query done from the Database can take seconds.

But watch out, destroying all your data from there can also take only a brief moment… :slight_smile:

Thanks for reply
Sure I know it.My question was a little different.
I mean, can the system work as if in parallel? for example, user A decided to delete all his contacts, for example, 10,000 of them.
At this time, user B decided to log in suitecrm and see or create several accounts.
Will he be able to do this until the user A has finished his deletion?
I know that the resources of the system can be limited, for example, at low resources the creation of accounts by user B might take longer than usual.
But in my case, when I deleted 3000 contacts, the system simply did not respond to requests from other users and me too until the deletion was completed.
By the way it was 1-2 minutes

I think it was working in parallel, at least if your web server configuration permitted it, which it probably did. It also depends on the database configuration.

But the parallel activity wasn’t effective because the server was too swamped. If Linux is swapping memory like crazy (likely if you’re only using 1GB) nothing is going to be working well in the system. You can see this happening from the console, check your swap activity with top or htop or other programs.

1 Like

thanks
this is what I wanted to know

hello sir

I try to import data with 20000 records and after 5 minutes I got this error " Getaway Timeout…"
But import didn’t cancel it was importing like “silent import” . During this “silent import” my web server is working very slow and when I refresh any other web pages it’s often getting Gateway error.
But at this moment I could watch the import process via MySQL I refresh the page and could see how the display of lines increased. So import was successfully completed after 10 minutes. (not showed successful message it’s just let my web server work and I checked new records…

I have Linux server, 1 GB memory, 1 core cpu…
I know this a little, but I’m only testing the service so far. And now this is enough to work with the exception of imports. problems begin with it already with 3000-5000 records.
Please look at the screen. Could you suggest a comfortable configuration for the system. How many cores are needed? The memory?
But what interests me most is that these capacities are needed specifically for imports, since without it, this works well
image
upd: sure i set memory_limit=1024 and max_execution_time= 36000

It’s hard to know, but if I was in your position the first thing I’d try would be adding memory.

I changed my config so right now i have 2 CPU cores and 4 GB RAM. Sure i changed php_limit to 3gb
But the problems are still the same.
I still get the error (exactly 5 minutes of import) and then the background import occurs
Have you any tips or idea how can I modify my Bitnami LAMP stack config? (I mean apache/php)
The only idea in my head right now is to try to install Bitnami SuiteCRM and transfer my suitecrm system files there. What do you think of it?

What do you see in Admin / Diagnistic / phpinfo, max_execution_time parameter?

36000
I changed it a long time ago

You need to understand what exactly is breaking your import. Maybe it’s a particular record that has something that breaks SuiteCRM (though this is not likely).

Maybe all you need to do is to break up your Import in smaller chunks.

Or use a different import method, like a PHP importer script (which greatly facilitates adding relationships ans security records). Example here.

Or try some of these techniques: http://www.jsmackin.co.uk/suitecrm/large-imports-in-suitecrm/

It depends on many parameters, it is always better to perform import / delete in smaller batches. Please have a look for below parameters, you may exaggerate before import and adjust afterwards to normal values:

php.ini
upload_max_filesize
max_file_uploads
post_max_size
max_execution_time
max_input_time
memory_limit

apache/nginx
TimeOut
ProxyTimeout

config.php
‘import_max_execution_time’ =>

I have increased those parameters before import and imported 20K Accounts&Contacts, more than 100K notes, tasks without any issues at once for each module in total around 4 hours. (7.11.13 on CentOs, VM-4 Cores and 3GB RAM, SSD)

Some points to consider:

  1. Make sure your database is pruned before. The default scheduler task does well the cleaning(if activated, on every 1st of month) for already soft deleted records. It would be better to perform database/table optimisation/maintenance for bigger tables before import/delete .

  2. Make sure none of the automatic scheduler jobs(cron jobs) running at the moment that you perform import/delete. Try to perform these tasks at when no users exists. As all the new Insert/Updates updates the indexes in DB there are lots of locking process/overhead exists in addition to creating regular data. It would be better to perform without any other disturbance to your process or vice versa.

  3. If you Import Accounts, it is rather simple, if you import Contacts make sure that all related Accounts already created before otherwise it tries to create them and relate. Same for other object which is related to parent modules. Adding a module is not simple as adding one row of database table, it tries to add many implicit records during import(like Security Group rows depending on your Security configuration)

  4. For deletes, it is similar, it soft deletes but it tries to mark/update every related table/row. I always experience longer times for deleting the rows.

  5. If you experience Timeout on your browser screen, consider that it still runs as a process in the background. This is same for import or delete. If you try to re-start your import / delete than you will possibly congest your the insert / updates.

  6. Do check the following. File names depend on your configuration.
    suitecrm.log
    php_errors.log - background tasks php logs
    www-error.log - foreground tasks php logs

1 Like