{"id":18267656,"url":"https://github.com/oxeu/url-test","last_synced_at":"2025-04-09T02:27:19.828Z","repository":{"id":229782513,"uuid":"621704975","full_name":"OXeu/url-test","owner":"OXeu","description":"A simple producer-consumer URL valid test tool based on goroutine and channel","archived":false,"fork":false,"pushed_at":"2023-03-31T08:28:37.000Z","size":3679,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-14T20:57:18.534Z","etag":null,"topics":["golang","url-test"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OXeu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-03-31T08:00:35.000Z","updated_at":"2023-03-31T08:49:49.000Z","dependencies_parsed_at":"2024-03-26T08:43:44.675Z","dependency_job_id":null,"html_url":"https://github.com/OXeu/url-test","commit_stats":null,"previous_names":["oxeu/url-test"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OXeu%2Furl-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OXeu%2Furl-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OXeu%2Furl-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OXeu%2Furl-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OXeu","download_url":"https://codeload.github.com/OXeu/url-test/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247964467,"owners_count":21025196,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","url-test"],"created_at":"2024-11-05T11:28:11.720Z","updated_at":"2025-04-09T02:27:19.807Z","avatar_url":"https://github.com/OXeu.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# URL-Test\n检测URL列表能否正常打开\n\n# 检测速度\n### 测试设备配置  \n**CPU** 13th Gen Intel(R) Core(TM) i5-13600K 3.50 GHz  \n**内存** 32GB 3200MHz  \n**系统** Windows 10 22H2\n\n平均速度120万条URL/小时\n\n# 工作原理\n1. 一个Reader逐行读取需要验证URL的CSV表，将URL添加到一个具有1024缓冲容量的channel\n2. 启动1024个Worker从channel中取出URL，对URL发起GET请求，如果响应超时（10s）或错误，则认定为无法打开，否则视为可以打开\n3. 每个worker持有一个独立的http.Client，避免每次请求都创建一个Client增加内存开销\n4. Worker获得验证结果后异步调用writer，将结果追加至结果CSV文件中\n5. writer在初始化时创建一个文件对象用于保存结果，每次调用write都会追加写入到该文件中\n6. 按 Ctrl + C 停止程序后会通知Reader不要再添加URL到channel中，并等待所有worker消费完channel中剩下的URL后将有效和无效的数量保存至kv.txt文件\n\n# 现有问题\n内存占用会随着时间增加逐步上升，实测100min跑约200万条URL后内存增长至14GB+","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foxeu%2Furl-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foxeu%2Furl-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foxeu%2Furl-test/lists"}