U
U
Us592019-06-23 14:31:27
Database design
Us59, 2019-06-23 14:31:27

How can I control proxy usage?

There is a table mb_proxyin which the list of IP are stored.
I need to control whether a certain IP is currently used or not, I created a column Usedin which I write 0 or 1 depending on the situation, but now I'm faced with the fact that I have 5 sites for which I use a proxy and the problem is this :
If I set Usedit to 1, then one of the sites (there may be 5, 6 or more) uses this IP for a curl request, and it turns out that the other 5 sites will wait, but I want to somehow indicate which specifically, the site uses this IP at the current time, so that with further selection from the database, I can take the same IP for requests on other sites.
Create 5 columns in the database and mark for eachUSEDit is possible, but somehow not practical, if there are more sites, creating 50 columns is stupid.
With a select query, I have a query to 2 tables, I think it will not be very beautiful to create a 3rd one either. In the 2nd table, I have IP records from which requests have already been made (request history to control limit limits). Are there any other solutions?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sim3x, 2019-06-23
@sim3x

5 sites, 5 proxies === hardcode for each site 1
proxy

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question